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: Table should not crash if filterDropdown is boolean #44357
Conversation
Run & review this pull request in StackBlitz Codeflow. |
size-limit report 📦
|
The latest updates on your projects. Learn more about Argos notifications ↗︎
|
Codecov ReportPatch coverage:
Additional details and impacted files@@ Coverage Diff @@
## master #44357 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 660 660
Lines 11230 11250 +20
Branches 3039 3041 +2
=========================================
+ Hits 11230 11250 +20
☔ View full report in Codecov by Sentry. |
components/menu/OverrideContext.tsx
Outdated
@@ -34,9 +35,17 @@ export const OverrideProvider = React.forwardRef< | |||
], | |||
); | |||
|
|||
const shouldRef = | |||
typeof children !== 'string' && |
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.
感觉这里可以用 isValidElement
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.
等会去改一下 supportRef
{ | ||
title: 'Name', | ||
dataIndex: 'name', | ||
filterDropdown: true, |
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.
filterDropdown 为啥可以为 true?
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.
ReactNode 包含 boolean
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.
虽然是不期望的用法,但是用户依赖了这个特性,并且以前的版本是 work 的
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.
好的,居然以前是 ok 的。
[中文版模板 / Chinese template]
🤔 This is a ...
🔗 Related issue link
close #44351
💡 Background and solution
📝 Changelog
filterDropdown
do not supportref
.filterDropdown
不支持ref
时报错的问题。☑️ Self-Check before Merge
🚀 Summary
🤖 Generated by Copilot at fab89f5
Improved the menu component's ref handling and added a regression test for the table component's filter dropdown. These changes fix a bug and enhance the performance and usability of the components.
🔍 Walkthrough
🤖 Generated by Copilot at fab89f5
supportRef
function to check children's ref support (link)OverrideProvider
component to conditionally clone children with ref (link)filterDropdown
prop (link)filterDropdown
is boolean (issue #32879, link)