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.

Textfield layout breaks when no value

See original GitHub issue

If you have a Textfield and delete it’s value, the layout can become broken:

textfield

It looks like because it only has this class when there is a value: https://github.com/prateekbh/preact-material-components/blob/master/Textfield/Textfield.jsx#L73-L75

This can occur when your Textfield is connected to state, e.g,:

<Textfield value={ this.state.lastName } onInput={ e => this.setState({ lastName: e.target.value }) } />

Issue Analytics

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

github_iconTop GitHub Comments

1reaction
gpoitchcommented, Sep 3, 2017

Indeed, i didn’t add all the features yet 😀, but showing that you may not have to track floating and focus state since it looks like material-components-web is handling that.

0reactions
prateekbhcommented, Sep 4, 2017

ok so the problem in hand(layout breakage) is caused by this line: https://github.com/prateekbh/preact-material-components/blob/master/Textfield/Textfield.jsx#L73

I guess a simple change to 'value' in props should fix the problem in hand.

Read more comments on GitHub >

github_iconTop Results From Across the Web

TextField inside of Row causes layout exception
Using this method breaks mainAxisAlignment for the Row widget. With two text widgets there's no problem but with a text widget and a...
Read more >
The Textarea element - HTML: HyperText Markup Language
Possible values are: hard : The browser automatically inserts line breaks (CR+LF) so that each line is no longer than the width of...
Read more >
Handle changes to a text field - Flutter documentation
The simplest approach is to supply an onChanged() callback to a TextField or a TextFormField . Whenever the text changes, the callback is...
Read more >
Restrict data input by using validation rules - Microsoft Support
When data is entered, Access checks to see whether the input breaks a validation rule – if so, the input is not accepted,...
Read more >
How to add extra spaces in a text field for better display?
You can add extra spaces in labels by using NO-BREAK SPACE character (U+00A0) generated by the key combination Alt+0160 on Windows. It is...
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