-
-
Notifications
You must be signed in to change notification settings - Fork 49.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: 修复 Tag onClick 为 undefined,鼠标点击也会出现边框样式 #40023
Conversation
size-limit report 📦
|
Codecov ReportBase: 99.99% // Head: 100.00% // Increases project coverage by
Additional details and impacted files@@ Coverage Diff @@
## master #40023 +/- ##
========================================
Coverage 99.99% 100.00%
========================================
Files 603 603
Lines 10256 10261 +5
Branches 2728 2733 +5
========================================
+ Hits 10255 10261 +6
+ Misses 1 0 -1
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. ☔ View full report at Codecov. |
@@ -119,7 +119,8 @@ const InternalTag: React.ForwardRefRenderFunction<HTMLSpanElement, TagProps> = ( | |||
}; | |||
|
|||
const isNeedWave = | |||
'onClick' in props || (children && (children as React.ReactElement<any>).type === 'a'); | |||
typeof props.onClick === 'function' || | |||
(children && (children as React.ReactElement<any>).type === 'a'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
解决什么问题?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@crazyair 来改一下 Changelog ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
<Tooltip title="title">
<Tag>demo</Tag>
</Tooltip>
hover 的 Tooltip,会给 children 注入 onClick,导致鼠标点击 Tag 会出现边框样式
* fix: 修复 Tag onClick 为 undefined 的判断方式 * feat: function
[中文版模板 / Chinese template]
🤔 This is a ...
🔗 Related issue link
💡 Background and solution
📝 Changelog
☑️ Self-Check before Merge