Skip to content

Commit 48f129d

Browse files
committed
fix(results): fix issue with results not being updated below treshold
1 parent e430436 commit 48f129d

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/GoogleAutocomplete.tsx

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -135,6 +135,10 @@ export const useGoogleAutocomplete = (apiKey: string, opts: Options = {}) => {
135135
if (debouncedTerm.length >= minLength) {
136136
search(debouncedTerm);
137137
}
138+
139+
if (debouncedTerm.length < minLength) {
140+
setLocationResults([]);
141+
}
138142
}, [debouncedTerm]);
139143

140144
return {

0 commit comments

Comments
 (0)