Repository navigation
fix: support data attributes in closable - #420
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. Walkthrough
Changes关闭按钮属性转发
Estimated code review effort: 2 (Simple) | ~10 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 #420 +/- ##
=======================================
Coverage 99.21% 99.21%
=======================================
Files 12 12
Lines 381 382 +1
Branches 103 103
=======================================
+ Hits 378 379 +1
Misses 3 3 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Notification 的 closable 对象目前既未声明 data-,也未将其透传到关闭按钮。本次在现有 ClosableConfig 上补充 data- 索引类型,并使用 pickAttrs 的 { aria: true, data: true } 配置提取属性,沿现有渲染路径传给实际关闭按钮。
新增公开入口测试,覆盖 useNotification 默认配置、单条通知配置、Notification 和 NotificationList;验证 data-*、aria-label、role、closable=false、配置整体覆盖规则及关闭回调参数与次数。同时保留现有 disabled 行为,确认普通 DOM 属性和额外事件不会被透传。
验证:
本次仅补齐兼容性支持,不修改图标、默认显隐、自动关闭、销毁或回调语义,不推进 V7 的 closable 行为统一。
参考:ant-design/ant-design#59667
Summary by CodeRabbit
data-*属性;原有aria-*属性转发保持不变。