Repository navigation
fix: support data attributes in closable - #591
Conversation
|
@QDyanbing is attempting to deploy a commit to the React Component Team on Vercel. A member of the Team first needs to authorize it. |
|
No actionable comments were generated in the recent review. Walkthrough关闭按钮现在会透传 Changes关闭按钮属性透传
Estimated code review effort: 2 (Simple) | ~8 minutes Change: Feature Suggested reviewers: Merge Risk:
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #591 +/- ##
=======================================
Coverage 98.95% 98.95%
=======================================
Files 8 8
Lines 192 192
Branches 69 69
=======================================
Hits 190 190
Misses 2 2 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Dialog 的 closable 对象目前既未声明 data-,也未将其透传到关闭按钮。本次补充 data- 索引类型,并使用 pickAttrs 的 { aria: true, data: true } 配置提取按钮属性。
通过 Dialog 公开入口验证 data-testid、数值型 data-*、aria-label 和 role,确认 disabled 时按钮仍显示且禁用,关闭点击仍调用原有回调,普通 DOM 属性和额外事件不会被透传。保留图标、遮罩关闭、Esc、退出动画及回调行为。
验证:
本次仅补齐兼容性支持,不推进 V7 的 closable 行为统一。
参考:ant-design/ant-design#59667
Summary by CodeRabbit
aria-*和data-*属性,包括数值型data-*属性,便于配置无障碍信息和自定义标识。onClick也不会因此触发。