-
-
Notifications
You must be signed in to change notification settings - Fork 32.4k
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
[joy-ui][ButtonGroup] Broken styles with custom button elements #39372
Comments
@PhillipWinder you are correct, And one more thing I observed -> if |
if this issue is ready to take, can I work on this? |
@vineetjk go for it! 🙌 |
sure @danilo-leal, I will work on this |
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
I have found the cause for this bug.. |
Indeed, it should function with custom buttons. You can make it work by spreading the props to the Button element using this code: const A = (props) => {
return <Button {...props}>hi</Button>;
}; You can see an example here: CodeSandbox Link. I believe the solution is to utilize the React Context API instead of cloneElements for ButtonGroup. This way, the Joy UI Button component can apply the data-* attributes to the DOM even when wrapped with a custom element. |
Hi @ZeeshanTamboli, |
Indeed, that's why I suggested using the Context API; it's what Material UI relies on internally. |
Yeah I got it, sure I will do the changes.. |
I wrote on the newer issue but just to make sure but I'll write here just in case, I have opened a PR proposal, I managed to fix it by just using CSS. |
Duplicates
Latest version
Steps to reproduce 🕹
https://codesandbox.io/s/affectionate-wiles-xzrrzp?file=/Demo.tsx
Current behavior 😯
The borders of the ButtonGroup are not rounded.
Expected behavior 🤔
The borders of the ButtonGroup should be rounded.
Context 🔦
No response
Your environment 🌎
@mui/joy 5.0.0-beta.9
The text was updated successfully, but these errors were encountered: