Skip to content

Commit

Permalink
fix: πŸ› suggestions now appear after minimum value set #387 (#403)
Browse files Browse the repository at this point in the history
βœ… Closes: #387
  • Loading branch information
Paul-Taiwo authored Jan 17, 2023
1 parent 80b530a commit 242c0f5
Showing 1 changed file with 9 additions and 8 deletions.
17 changes: 9 additions & 8 deletions src/PlacesAutocomplete.js
Original file line number Diff line number Diff line change
Expand Up @@ -233,14 +233,15 @@ class PlacesAutocomplete extends React.Component {
handleInputChange = event => {
const { value } = event.target;
this.props.onChange(value);
this.setState({ userInputValue: value });
if (!value) {
this.clearSuggestions();
return;
}
if (this.props.shouldFetchSuggestions) {
this.debouncedFetchPredictions();
}
this.setState({ userInputValue: value }, () => {
if (!value) {
this.clearSuggestions();
return;
}
if (this.props.shouldFetchSuggestions) {
this.debouncedFetchPredictions();
}
});
};

handleInputOnBlur = () => {
Expand Down

0 comments on commit 242c0f5

Please sign in to comment.