Jishun / react-validated-input

Instance based validated input component for react
MIT License
12 stars 1 forks source link

uncontrolled input element #3

Closed msimonc closed 8 years ago

msimonc commented 8 years ago

Thanks again for this,

If I render: <Input type="text" validate={this.state.validation} instance={this.state._addr} propertyKey="street" rules={{presence: true}} >

The field displays the value, but when I delete (backspace) the last remaining character from the field I get:

Warning: A component is changing a controlled input of type text to be uncontrolled. Input elements should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled input element for the lifetime of the component. More info: https://fb.me/react-controlled-components

Jishun commented 8 years ago

react version added more validation. use empty default value to ensure that the input is controlled fix published in version 0.0.10

msimonc commented 8 years ago

work perfectly now. Thanks again from Sydney Australia