-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
[Bug]: Toggle labelA and labelB are still being ignored when hideLabel is tur #13004
Comments
Related to #12974 @janhassel Was this intentional? It appears so
|
There's a related docs issue as well, #12999 |
@kglickman I think this is mainly a documentation issue now, as @tay1orjones mentioned. You can achieve your use case by just not passing <div id="toggle_label">This is the label</div>
<Toggle
aria-labelledby="toggle_label"
id="toggle_id"
labelA="On"
labelB="Off"
/> |
@janhassel I tried that but it didn't help. https://stackblitz.com/edit/github-jsd1gh-1n1yiu |
Oh, I see. You need to get rid of the hideLabel as well. |
@janhassel I have it displaying correctly but the onToggle is never getting called when the user clicks on it. |
@kglickman Thanks for reporting this. That seems to be a severe bug introduced with the mentioned changes that unfortunately didn't get caught in automated testing. I apologize. @tay1orjones |
Package
@carbon/react
Browser
No response
Package version
1.2.1
React version
16.14.0
Description
The intent of the last fix for #12896 was to allow us to still use labelA and labelB when using hideLabel and aria-labelledby to label the component in an external element. However, there is now no label next to the toggle at all.
Suggested Severity
Severity 2 = User cannot complete task, and/or no workaround within the user experience of a given component.
Reproduction/example
https://stackblitz.com/edit/github-jsd1gh
Steps to reproduce
See that the toggle has no label to right of the toggle, even though I have defined labelA and labelB and have added the aria-labelledby with my hideLabel.
Code of Conduct
The text was updated successfully, but these errors were encountered: