fix: support manual input clearing - #1006
Conversation
|
@nrps9909 is attempting to deploy a commit to the afc163's projects Team on Vercel. A member of the Team first needs to authorize it. |
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Advanced Run ID: 📒 Files selected for processing (7)
🚧 Files skipped from review as they are similar to previous changes (1)
Included review availability: Your plan provides up to 2 included reviews per hour; 1 remains after this review. Walkthrough本次修改支持通过删除输入文本清空单值和范围值。可清除输入会传递 Changes手动清空与范围悬停
Estimated code review effort: 3 (Moderate) | ~20 minutes Severity of issue fixed: Medium Sequence Diagram(s)sequenceDiagram
participant 用户
participant 输入组件
participant 选择器
participant RangePicker
用户->>输入组件: 删除输入文本
输入组件->>选择器: onChange(null)
选择器->>RangePicker: 提交空值
RangePicker->>RangePicker: 按 allowEmpty 更新范围
RangePicker-->>用户: 关闭弹窗并更新输入值
Suggested reviewers: Merge Risk: ⚪ Minimal · up to Pickers now treat manual empty input as a clear action when allowed, while preserving reset behavior when clearing is disabled. The covered single, range, masked-input, and partial-range behaviors show no remaining concrete merge-blocking risk. 🚥 Pre-merge checks | ✅ 3 | ❌ 2❌ Failed checks (2 warnings)
✅ Passed checks (3 passed)
✨ Finishing Touches 💡 1🛠️ Fix failing CI checks 💡
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. 小兔删去日期线, Comment |
这个 PR 在做什么这个 PR 将手动删除输入内容转换为 Picker 的清除操作。这里的判断基准应是 结论有条件合并 整体方向正确,但 mask 路径仍然额外依赖已有合法 问题清单🔴 高优先级(阻塞合并)
🟡 中优先级(建议修复)
🟢 低优先级(可选改进)无。 |
|
已依照建議修正,並合入最新 master。GitHub-Verified head
完整測試 16 suites / 490 passing / 2 skipped / 29 snapshots;TypeScript、compile、lint、Prettier、diff checks 通過。PR 描述已更新,遠端 CI 另行追蹤。謝謝指出這個邊界。 遠端驗證更新:相同 head 的 GitHub Actions 已完成,lint、TypeScript、compile、coverage test 全通過(16 suites / 490 passed / 2 skipped / 29 snapshots)。Vercel 狀態為 |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #1006 +/- ##
=======================================
Coverage 98.88% 98.89%
=======================================
Files 68 68
Lines 2868 2886 +18
Branches 818 800 -18
=======================================
+ Hits 2836 2854 +18
Misses 29 29
Partials 3 3 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Manual deletion now follows the existing clear action for clearable single and range inputs, including masked text with no valid selected date. Clearing capability uses
isReactRenderableon the normalized clear icon, independently of whether the button is currently visible. Range clearing preserves the opposite endpoint only when the edited field allows empty;allowClear={false}retains its prior behavior.Closes #946. Related to ant-design/ant-design#52473.
Validation on signed/GitHub-Verified head
f29a7b7adee3597211a681cd16a61d0214d0d29e, after merging master58a1d980b69f15e1bb962b05e66f74f803a6b895:2024-02-31, select all, and delete. Before the follow-up fix, both enabled-clear cases fail with zeroonClearcalls; the disabled-clear control passes. After the fix all three pass, includingclearIcon: 0, the focused mask placeholder, and empty text after blur.AI assistance: Codex was used for implementation and local verification. The exact-head GitHub Actions run https://github.com/react-component/picker/actions/runs/34459884080 passes lint, TypeScript, compile, and the coverage test suite (16 suites / 490 passed / 2 skipped / 29 snapshots). Vercel deployment requires upstream team authorization; CodeRabbit review remains pending.
Summary by CodeRabbit
新功能
问题修复