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.

Label overlapping input

See original GitHub issue

https://material-ui.com/demos/text-fields/#limitations The documentation specify the following warning :

The input label “shrink” state isn’t always correct. The input label is supposed to shrink as soon as the input is displaying something. In some circumstances, we can’t determine the “shrink” state

I encounter this bug and will give you a hint : this is due to the undefined state of the value; in an input field, always specify the value as empty string instead of undefined

Under such circomstance, when combining with an object spread operatior {...props} will generate by the compiler something like this value=undefined. An undefined property is also considered non exist thus create the bug.

To fix this (as a workaround till the Core is fixed), always put a fallback empty for input value

value={this.state.value || ''}

sample.txt

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Reactions:19
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

10reactions
flyingangelcommented, Oct 11, 2018

I’ve already gave you the full file sample.txt. Here is how to use

<InputZipcode label="Zipcode" value={null} />
<InputZipcode label="Zipcode" />

This will create the overlap bug. To fix it, value must be force as empty string “” during props injection to Material Core Input

1reaction
oliviertassinaricommented, Oct 10, 2018

@flyingangel Could you share a reproduction live example then? Thank you.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Bootstrap labels are overlapping input text field - Stack Overflow
So, I'm using bootstrap 3.3.7 modal to show the edit form. but I see the weird behavior of control alignment on Html Page...
Read more >
Long Label overlapping Input - Material Design for Bootstrap
Hello!Is there a way to cut of the label of an Textinput? Because when the label is too long it starts overlapping the...
Read more >
Label overlapping input · Issue #13186 · mui/material-ui - GitHub
The input label "shrink" state isn't always correct. The input label is supposed to shrink as soon as the input is displaying something....
Read more >
Some form input labels are overlapping when aligning the ...
Hi,. I have a few issues with my form: 1. Some of the text overlaps with the text boxes. 2. When I embed...
Read more >
Fix Text Overlap with CSS white-space | SamanthaMing.com
Fix overlapping text by setting CSS white-space from. ... white-space; Assume Positive Intent When Working on Existing Code Base; Community Input; Resources ...
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