-
-
Notifications
You must be signed in to change notification settings - Fork 849
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
Missing button group style injections when updating children className (React) #1926
Comments
Thanks for posting this. We'll probably need to switch to data attributes. I don't think we can avoid React replacing the entire class when using |
Makes sense, I'm in fact working around this issue by using attributes.
This one is harder to work around with |
@Bielousov There actually is. I had forgotten about this issue, but im 99% positive I can fix this. Let me see what I can do. |
Reproduction here: |
Since its hard to test the React version, heres the bare HTML version: https://codepen.io/paramagicdev/pen/PogbZNb?editors=1000 <- Broken And heres the same codepen with the PR here: #1928 |
Describe the bug
The Button Group component injected class names are lost after updating child component's className.
To Reproduce
className
property after it is mountede.g.:
Expected: the updated Button className should should have both
className
and injected Shoelace class namesActual: only default className classes are set to the button inside the ButtonGroup
Presumably for the same reason, internal button group class names are also often reset after a hot refresh in dev.
Screenshots
class="test1 sl-button-group__button sl-button-group__button--first"
class="test2"
class="test1 sl-button-group__button sl-button-group__button--last"
class="test2"
The text was updated successfully, but these errors were encountered: