Skip to content
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

Toggle labels display on 2 lines when too long #5771

Closed
cdouine39 opened this issue Apr 1, 2020 · 1 comment
Closed

Toggle labels display on 2 lines when too long #5771

cdouine39 opened this issue Apr 1, 2020 · 1 comment

Comments

@cdouine39
Copy link

cdouine39 commented Apr 1, 2020

[Toggle labels]: When labels are long, they get displayed on 2 lines

What package(s) are you using?

image

Detailed description

Describe in detail the issue you're having.

When i use a toggle with long labels, they appear on 2 lines while there is a lot of space to display them on 1 line :
image

Is this issue related to a specific component?

Yes, Toggle component

What did you expect to happen? What happened instead? What would you like to
see changed?

I would expect the label to be displayed on 1 line like this :
image

What browser are you working in?

Chrome 80

Please create a reduced test case in CodeSandbox
https://codesandbox.io/s/carbon-components-react-qojzy

@emyarod
Copy link
Member

emyarod commented Apr 1, 2020

it looks like your dependencies are out of date and this is a fixed issue in newer package versions (ref #5392 #5393)

the workaround for you would be to add this to your stylesheet:

.bx--toggle__text--left,
.bx--toggle__text--right {
  white-space: nowrap;
}

@emyarod emyarod closed this as completed Apr 1, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants