-
Notifications
You must be signed in to change notification settings - Fork 6.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
Improve slide-toggle text label #5212
Comments
I think there was a reason why we didn't do that. I will try to figure out why. |
The reason I didn't add the text ellipsis to the slide-toggle was that the label of the slide-toggle does have a dynamic width (and therefore the ellipsis couldn't work properly) There are workarounds for flexbox containers to properly show a text ellipsis. .mat-slide-toggle-label {
flex: 1;
* {
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
} @jelbourn Do you think we should do something like that? I feel like it's not good to reach out of the components view (with the CSS selector) |
Why does it have a dynamic width? |
Because the slide-toggle adjusts its with depending on the content (specified from the user) This seems to be an issue with FlexBox elements (while it works with inline block for example) |
Seems that as of PR #6674 this is the intended behaviour for both |
* Instead of showing the text overflow of slide-toggle content, an ellipsis for too long labels will be shown. Fixes angular#5212
* Instead of showing the text overflow of slide-toggle content, an ellipsis for too long labels will be shown. Fixes #5212
* Instead of showing the text overflow of slide-toggle content, an ellipsis for too long labels will be shown. Fixes #5212
* Instead of showing the text overflow of slide-toggle content, an ellipsis for too long labels will be shown. Fixes angular#5212
This issue has been automatically locked due to inactivity. Read more about our automatic conversation locking policy. This action has been performed automatically by a bot. |
Bug, feature request, or proposal:
Proposal
What is the expected behavior?
The text of the slide-toggle should wrap or be ellipsed like md-checkbox.
What is the current behavior?
The label push de content out of its parent.
What are the steps to reproduce?
Demo: http://plnkr.co/edit/MZ3fzeJKCyBvGIBphl2P?p=preview
Which versions of Angular, Material, OS, TypeScript, browsers are affected?
angular/material: 2.0.0-beta.6-0aaeb69
Is there anything else we should know?
¿Remove
white-space: nowrap
?The text was updated successfully, but these errors were encountered: