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(Collapse): pass otherProps to Collapse container #47897
Conversation
Run & review this pull request in StackBlitz Codeflow. |
👁 Visual Regression Report for PR #47897 Failed ❌
Check Full Report for details |
|
This pull request is automatically built and testable in CodeSandbox. To see build info of the built libraries, click here or the icon next to each commit SHA. |
components/collapse/Collapse.tsx
Outdated
@@ -163,6 +164,7 @@ const Collapse = React.forwardRef<HTMLDivElement, CollapseProps>((props, ref) => | |||
prefixCls={prefixCls} | |||
className={collapseClassName} | |||
style={{ ...collapse?.style, ...style }} | |||
{...otherProps} |
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.
ant-design/components/radio/group.tsx
Line 110 in 31ff625
{...pickAttrs(props, { aria: true, data: 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.
Looks like I overlooked that we already doing spread here https://github.com/ant-design/ant-design/pull/47897/files/57f8be7c57c325c8916e08399a8ec33dd9845349#diff-3541251bb31318316b91e1f6710b646bd92edaff4318ca790c6401bea6962fc9R162
And it could be not a problem in Antd. Sorry for disturbing
Looks like React component Collapse doesn't allow passing attribute props inside. While I overlooked and Antd actually do it from your side So corresponding PR created in rc-collapse: react-component/collapse#344 Hope it makes sense |
[中文版模板 / Chinese template]
🤔 This is a ...
🔗 Related issue link
💡 Background and solution
Problem: Collapse container can't get any data-* attributes
Solution: spread otherProps was passed to the Collapse container
📝 Changelog
☑️ Self-Check before Merge