Textfield layout breaks when no value
See original GitHub issueIf you have a Textfield and delete it’s value, the layout can become broken:
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:
- Created 6 years ago
- Comments:15 (8 by maintainers)
Top 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 >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
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.
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.