Skip to content

Commit

Permalink
Fix issue if the initialValue changes
Browse files Browse the repository at this point in the history
  • Loading branch information
jspears committed Sep 25, 2015
1 parent 30cbcc8 commit b739b5c
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/Geosuggest.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,15 @@ var Geosuggest = React.createClass({
.AutocompleteService()
};
},
/**
* Change inputValue if prop changes
*/
componentWillReceiveProps(props){
if (this.props.initialValue !== props.initialValue){
this.setState({userInput:props.initialValue});
}
},


/**
* When the input got changed
Expand Down

0 comments on commit b739b5c

Please sign in to comment.