Skip to content

Commit

Permalink
fix(results): fix issue with results not being updated below treshold
Browse files Browse the repository at this point in the history
  • Loading branch information
EQuimper committed Jul 16, 2024
1 parent e430436 commit 48f129d
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/GoogleAutocomplete.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,10 @@ export const useGoogleAutocomplete = (apiKey: string, opts: Options = {}) => {
if (debouncedTerm.length >= minLength) {
search(debouncedTerm);
}

if (debouncedTerm.length < minLength) {
setLocationResults([]);
}
}, [debouncedTerm]);

return {
Expand Down

0 comments on commit 48f129d

Please sign in to comment.