Skip to content
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

Closed

Conversation

destimon
Copy link
Contributor

[中文版模板 / Chinese template]

🤔 This is a ...

  • New feature
  • Bug fix
  • Site / documentation update
  • Demo update
  • Component style update
  • TypeScript definition update
  • Bundle size optimization
  • Performance optimization
  • Enhancement feature
  • Internationalization
  • Refactoring
  • Code style optimization
  • Test Case
  • Branch merge
  • Workflow
  • Other (about what?)

🔗 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

Language Changelog
🇺🇸 English Fixed props passing in the Collapse component
🇨🇳 Chinese

☑️ Self-Check before Merge

⚠️ Please check all items below before requesting a reviewing. ⚠️

  • Doc is updated/provided or not needed
  • Demo is updated/provided or not needed
  • TypeScript definition is updated/provided or not needed
  • Changelog is provided or not needed

Copy link

stackblitz bot commented Mar 15, 2024

Review PR in StackBlitz Codeflow Run & review this pull request in StackBlitz Codeflow.

Copy link
Contributor

github-actions bot commented Mar 15, 2024

👁 Visual Regression Report for PR #47897 Failed ❌

🎯 Target branch: master (5574f31)
📖 View Full Report ↗︎

Image name Expected Actual Diff
qr-code-Popover.dark.png master: 5574f31576f4ad39dcddacd511b84fd24cf2f086 current: pr-47897 diff
qr-code-Popover.dark.css-var.png master: 5574f31576f4ad39dcddacd511b84fd24cf2f086 current: pr-47897 diff

Check Full Report for details

Copy link
Contributor

  • 🚨 Please fill changelog in the PR

    • Write with a developer-oriented perspective and narrative method, without describing the details of the repair
    • Describing the problem and the impact on the developer
    • describing the user-first site problem, not your solution
    • Refer: https://ant.design/changelog#501
  • 🚨 请填写 PR 中的 changelog

    • 请用面向开发者的角度叙述方式撰写,不描述修复细节
    • 描述问题和对开发者的影响
    • 描述用户第一现场的问题,而非你的解决方式
    • 参考:https://ant.design/changelog-cn#501

Copy link
Contributor

github-actions bot commented Mar 15, 2024

Preview is ready

Copy link

codesandbox-ci bot commented Mar 15, 2024

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.

@@ -163,6 +164,7 @@ const Collapse = React.forwardRef<HTMLDivElement, CollapseProps>((props, ref) =>
prefixCls={prefixCls}
className={collapseClassName}
style={{ ...collapse?.style, ...style }}
{...otherProps}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

{...pickAttrs(props, { aria: true, data: true })}

Copy link
Contributor Author

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

@destimon
Copy link
Contributor Author

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

@destimon destimon closed this Mar 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants