className
Prop Doesn't Apply to Button Element in ToggleButton
#7630
Labels
Type: Bug
Issue contains a defect related to a specific component.
Milestone
Describe the bug
I expected the following code to apply the
className
dynamically based on thechecked
state of theToggleButton
:However, when I rendered this component, the visual result didn’t match my expectations.
Here is the screenshot for reference:
I realized that the background color for the button is not changing as expected based on the checked state. After inspecting the DOM structure, I found that the className prop is being applied to the wrapper element (the input and button container), instead of the actual element.
This behavior makes it difficult to directly style the button’s appearance based on its checked state.
Observed Behavior
The className prop is currently applied to the wrapper element, which prevents the desired styling of the button’s background.
Reproducer
No response
System Information
Steps to reproduce the behavior
Expected behavior
The className prop should ideally be applied to the
element itself so that styling can be dynamically adjusted based on the checked state.The text was updated successfully, but these errors were encountered: