Skip to content

Commit

Permalink
add form clearing for params keys, bug fix. Issues #27
Browse files Browse the repository at this point in the history
  • Loading branch information
Xia Amendolara committed Sep 20, 2017
1 parent 335f0b6 commit c958023
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion app/src/scripts/common/forms/input.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,13 @@ let Input = React.createClass({
};
},

componentWillReceiveProps(nextProps) {
// Will reset value when prop changes
if ('value' in nextProps) {
this.setState({value: nextProps.value})
}
},

propTypes: {
initialValue: React.PropTypes.string,
placeholder: React.PropTypes.string,
Expand All @@ -22,7 +29,7 @@ let Input = React.createClass({
value: React.PropTypes.string,
onChange: React.PropTypes.func,
disabled: React.PropTypes.bool,
checekd: React.PropTypes.bool
checked: React.PropTypes.bool
},

render() {
Expand Down

0 comments on commit c958023

Please sign in to comment.