We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 1a95776 commit ae0a8baCopy full SHA for ae0a8ba
1 file changed
src/sidebar/search/AddressInput.tsx
@@ -85,11 +85,15 @@ export default function AddressInput(props: AddressInputProps) {
85
}, [props.point])
86
87
useEffect(() => {
88
- if (hasFocus && !isInitialFocus.current && text === '') {
+ if (!hasFocus) return
89
+ if (isInitialFocus.current) {
90
+ isInitialFocus.current = false
91
+ return
92
+ }
93
+ if (text === '') {
94
const recents = buildRecentItems(undefined, 5, excludeCoord)
95
if (recents.length > 0) setAutocompleteItems(recents)
96
}
- isInitialFocus.current = false
97
}, [hasFocus, excludeCoord])
98
99
// highlighted result of geocoding results. Keep track which index is highlighted and change things on ArrowUp and Down
0 commit comments