Skip to content

Commit

Permalink
Fix issue where inputs flip between controlled and uncontrolled...
Browse files Browse the repository at this point in the history
Fixes the following warning:

```
Warning: FriggingBootstrap.Input is changing a uncontrolled input
of type text to be controlled. Input elements should not switch from
uncontrolled to controlled (or vice versa). Decide between using a
controlled or uncontrolled input element for the lifetime of the
component.
```

frig-js/frigging-bootstrap#44 (comment)
  • Loading branch information
jbinto committed May 26, 2016
1 parent 60b19f9 commit 4e9d132
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/components/input.js
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ export default class Input extends React.Component {
this.context.frigForm.errors[this.props.name] || []
)}
saved={this.context.frigForm.saved[this.props.name]}
value={this.context.frigForm.data[this.props.name]}
value={this.context.frigForm.data[this.props.name] || ''}
onChange={this._onChange}
/>
)
Expand Down

0 comments on commit 4e9d132

Please sign in to comment.