Repository navigation
feat: support allowClear tabIndex - #207
Conversation
|
@QDyanbing 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
WalkthroughInput 和 TextArea 的 Changes清除按钮键盘导航
Priority: ⬇️ Low Estimated code review effort: 2 (Simple) | ~10 minutes Change: Feature Suggested reviewers: Merge Risk: ⚪ Minimal · up to The allowClear tabIndex change is mergeable after normal checks. Pre-merge checks |
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #207 +/- ##
=======================================
Coverage 98.36% 98.36%
=======================================
Files 11 12 +1
Lines 428 428
Branches 134 137 +3
=======================================
Hits 421 421
Misses 7 7 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
开启
allowClear后,Tab 会聚焦清除按钮,多输入框表单目前无法单独配置是否跳过该按钮。根据 ant-design/ant-design#59540 (comment) 的建议,为 Input 和 TextArea 的allowClear增加可选的tabIndex,通过共享的 BaseInput 传递给清除按钮。配置
allowClear={{ tabIndex: -1 }}后,Tab 和 Shift+Tab 会跳过清除按钮,鼠标仍可点击清除;未配置时保留默认键盘访问行为。同步更新 API 文档,并覆盖默认键盘清除、双向 Tab 导航、鼠标清除、动态配置和输入框自身 tabIndex 独立性的测试。验证:
Summary by CodeRabbit
Input和TextArea的清除按钮支持单独设置键盘导航顺序;设为-1时,按钮仍可点击清除,但不会被 Tab 键选中。