preact-material-components: Textfield layout breaks when no value

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 }) } />

About this issue

  • Original URL
  • State: closed
  • Created 7 years ago
  • Comments: 15 (8 by maintainers)

Most upvoted 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.