question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[Button] Button label text should not wrap

See original GitHub issue

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%.

Issue Analytics

  • State:open
  • Created 4 years ago
  • Reactions:20
  • Comments:5

github_iconTop GitHub Comments

13reactions
gissmncommented, Aug 12, 2021

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

3reactions
trdayacommented, Feb 10, 2022

For me, this worked

white-space: nowrap; 
min-width: auto;
Read more comments on GitHub >

github_iconTop Results From Across the Web

How to wrap text of HTML button with fixed width?
I've tried it with word-wrap, but that cuts of the word even though there are spaces available to wrap on.
Read more >
Gallery Button - Wrapping Text - Power Platform Community
No, it is not possible to wrap button text. In this scenario it might be better to use a label placed on top...
Read more >
Formatting text on buttons and in labels - Google Groups
The text simply runs off the screen. I can not seem to get them to "wrap" to another line at the edge of...
Read more >
Problem wrapping text into a button - MDBootstrap
I have a problem with a text in my button, when the text is to long, it overflow it. ... Send it via...
Read more >
Input group · Bootstrap v5.0
Input groups wrap by default via flex-wrap: wrap in order to accommodate custom form field validation within an input group. You may disable...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found