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: wired spacing when line breaks

See original GitHub issue
  • The issue is present in the latest release.
  • I have searched the issues of this repository and believe that this is not a duplicate.

Current Behavior 😯

There is additional space on the button left and right (see screenshot)

image

Expected Behavior 🤔

The button should shrink as without line breaks

Steps to Reproduce 🕹

Steps:

  1. Please note the maxWidth on the surrounding div.
  2. https://codesandbox.io/s/material-demo-3do1p?file=/demo.js

<div style={{ maxWidth: 170 }}>
    <Button variant="contained" color="primary">
        Send to somewhere
    </Button>
    <Button variant="contained" color="primary">
        Send to some
    </Button>
</div>

Context 🔦

THis issue might be related: https://github.com/mui-org/material-ui/issues/17494

Your Environment 🌎

Tech Version
Material-UI v4.9.9
React 16.13.1
Browser Linux Chrome Version 80.0.3987.162 (Official Build) (64-bit)
TypeScript
etc.

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:5 (1 by maintainers)

github_iconTop GitHub Comments

2reactions
oliviertassinaricommented, Apr 7, 2020

Tip, check the full-width option

0reactions
RobertHeimcommented, Apr 8, 2020

The button stops shrinking.

materialUiButtonShrinkBug

Read more comments on GitHub >

github_iconTop Results From Across the Web

Button: wired spacing when line breaks · Issue #20459 - GitHub
The issue is not about making the smaller one full-width but the additional space WITHIN the first button is unexpected and too much....
Read more >
Multiline HTML input button with line break adds unwanted ...
drinkButton { width:94px; height: 67px; font-size:1em; margin: 0px 6px 6px ... white-space: normal; padding: 0px; vertical-align:bottom; }.
Read more >
How to Create Button with Line Breaks - W3docs
Another way of adding a line break is using the CSS word-break property, which specifies how words should break when reaching the end...
Read more >
Remove extra whitespace caused by line break within a button
If the button text is too long and needs to be displayed on two lines, the padding of the button will automatically change...
Read more >
line spacing ??? - Beginners' Questions - Inkscape Forum
If that does not resolve the issue, activate the Tt button ("outer" text style) and set the font height to something small and...
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