material-components-web icon indicating copy to clipboard operation
material-components-web copied to clipboard

[Button] Button label text should not wrap

Open joyzhong opened this issue 5 years ago • 5 comments

Bug report

Button label text currently wraps if long, see spec/mdc-dialog/classes/overflow-accessible-font-size.html

Per https://material.io/design/components/buttons.html#anatomy, the button label should stay on a single line.

Screenshots

See our screenshot example: spec/mdc-dialog/classes/overflow-accessible-font-size.html

Possible solution

We should add to the button white-space: nowrap and to the label width: 100%.

joyzhong avatar Jul 11 '19 17:07 joyzhong

white-space: nowrap and min-width: max-content worked for me. Thank you@joyzhong

gissmn avatar Aug 12 '21 04:08 gissmn

For me, this worked

white-space: nowrap; 
min-width: auto;

trdaya avatar Feb 10 '22 22:02 trdaya

white-space: nowrap and min-width: max-content worked for me. Thank you@joyzhong

Either of these worked for me (didn't need both)

liranh85 avatar Apr 05 '22 08:04 liranh85

For me, this worked

white-space: nowrap; 
min-width: auto;

This worked for me too, thank @trdaya :)

gabrieldocs avatar May 17 '22 12:05 gabrieldocs

white-space: nowrap; 
min-width: auto;

This worked for me as well. Thanks, everyone!

vinntt avatar Nov 07 '22 19:11 vinntt