diff --git a/src/Geosuggest.jsx b/src/Geosuggest.jsx index 9774fd28..39342e5c 100644 --- a/src/Geosuggest.jsx +++ b/src/Geosuggest.jsx @@ -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