-
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 ignores labelA and labelB and uses labelText if hideLabel is specified #12896
Comments
cc @janhassel |
Hi @kglickman! Would passing your custom label as <Toggle
id="toggle-1"
hideLabel
labelText={(
<>
Label
<Tooltip label="Helper text">
<button>
<Information />
</button>
</Tooltip>
</>
)}
/> |
It does work for the use case I mentioned in the defect. However, we also have use cases where the label must be displayed outside the component. |
Hmm, for now you could manually set @tw15egan What do you think? Moving the top label to the side is a common use case seen throughout a lot of products which is why using Maybe one of the following options could work?
The second one seems more predictable imo. |
I agree. The second option seems like a more predictable solution for this scenario |
Package
@carbon/react
Browser
No response
Package version
1.19.0
React version
16.14.0
Description
We don't want to use the Carbon label for the toggle because we are providing our own label that includes a tooltip. We have set hideLabel to true but now it is using our labelText next to the toggle instead of using the labelA and labelB.
Suggested Severity
Severity 1 = Must be fixed ASAP. The response must be swift. Someone from the team must drop all current work and be immediately reassigned to address the issue.
Reproduction/example
https://stackblitz.com/edit/github-shdz33
Steps to reproduce
Set the values of labelA, labelB, labelText, and set hideLabel to true.
Code of Conduct
The text was updated successfully, but these errors were encountered: