[Text Field] Horizontal scroll when label is too long
See original GitHub issueDuplicates
- 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:
but it is possible to scroll to the right:
because the label is too long and not shortened:
Side information: Row and Column is from the library reactstrap.
Expected behavior 🤔
The label should not expand the website
Steps to reproduce 🕹
Steps:
- Open this codesandbox example: Example
- You have to open this in a new window. Open this in a new window:
- 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.
Context 🔦
No response
Your environment 🌎
No response
Issue Analytics
- State:
- Created 2 years ago
- Comments:8 (6 by maintainers)
Top 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 >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@RedHeadphone The
label
is not the faulty one. Thelegend
has no overflow:hidden. See initial post -> solution picture “legend
” does not haveoverflow:hidden
Can I submit PR?