Skip to content

Commit 4e706ea

Browse files
committed
TAB should not trigger geocode if we just pressed ENTER
1 parent 9f16994 commit 4e706ea

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/sidebar/search/AddressInput.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ export default function AddressInput(props: AddressInputProps) {
127127
if (item instanceof POIQueryItem) {
128128
handlePoiSearch(poiSearch, item.result, props.map)
129129
props.onAddressSelected(item.result.text(item.result.poi), undefined)
130-
} else if (highlightedResult < 0) {
130+
} else if (highlightedResult < 0 && !props.point.isInitialized) {
131131
// by default use the first result, otherwise the highlighted one
132132
getApi()
133133
.geocode(text, 'nominatim')
@@ -144,6 +144,7 @@ export default function AddressInput(props: AddressInputProps) {
144144
props.onAddressSelected(item.toText(), item.point)
145145
}
146146
}
147+
// do not disturb 'tab' cycle
147148
if (event.key == 'Enter') searchInput.current!.blur()
148149
break
149150
}

0 commit comments

Comments
 (0)