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.

[Text Field] Horizontal scroll when label is too long

See original GitHub issue

Duplicates

  • I have searched the existing issues

Latest version

  • I have tested the latest version

Current behavior 😯

If the label is too long, it affects the view of mobile clients (Android and Iphone)

Source Code:

<Row>
<Col>
<TextField
    id="vereinsmitgliedschaftsprozente"
    label={'THIS IS A VERY LONG LABEL AND THIS IS THE PROBLEM WHY THE SCREEN ON MOBILE DEVICES WILL BE EXPANDED'}
    value={user.vereinsmitgliedschaftsprozente}
    error={vereinsmitgliedschaftsprozenteerror}
    type="number"
    fullWidth={true}
    onChange={( event ) => {
        const tempUser = cloneDeep( user );
        tempUser.vereinsmitgliedschaftsprozente = +event.target.value;
        setUser( tempUser );
        setvereinsmitgliedschaftsprozenteerror( event.target.value.trim().length === 0 );
    }}
    margin="none"
/>
</Col>
</Row>

On Android or Iphone it looks like this: Bild1_MUI

but it is possible to scroll to the right: Bild2_MUI

because the label is too long and not shortened: Bild3_MUI

Side information: Row and Column is from the library reactstrap.

Expected behavior 🤔

The label should not expand the website

Steps to reproduce 🕹

Steps:

  1. Open this codesandbox example: Example
  2. You have to open this in a new window. Open this in a new window: Bild4_MUI
  3. When the new window is opened - go to the developer tools and go to responsive design - switch to iphone or any other android device

THE SOLUTION

The css is wrong: When you delete the “float” attribute it works as expected. Bild5_MUI

Context 🔦

No response

Your environment 🌎

No response

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:8 (6 by maintainers)

github_iconTop GitHub Comments

2reactions
Paul6552commented, Feb 23, 2022

@RedHeadphone The label is not the faulty one. The legend has no overflow:hidden. See initial post -> solution picture “legend” does not have overflow:hidden

1reaction
RedHeadphonecommented, Feb 23, 2022

Can I submit PR?

Read more comments on GitHub >

github_iconTop Results From Across the Web

TextBlock with a slider when text is too long in WPF
Vertical scroll bar appears, horizontal not. Even when text doesn't fit inside the TextBlock . c# · wpf · textblock.
Read more >
How to Create Scrolling Text With CSS [+ Code Examples]
CSS Horizontal Scrolling Text: Left-to-Right. For left-to-right scrolling text, simply swap the positive and negative translateX values.
Read more >
Easy Power Apps Scrollable Screen Using A Vertical Container
In this article I will show the easiest way to make a scrollable screen in Power Apps using a vertical container.
Read more >
How to make a scrollable multi-line Text - Apple Developer
Try defining the height of the Scrollview instead of the text. Posted 3 years ago by. Phred.
Read more >
Text input – Carbon Design System
This component can be used for long and short form entries. ... a text input then the value content can horizontally scroll inside...
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