From a5382ebb69dc8961c7aefc87cac21c0e7787bae8 Mon Sep 17 00:00:00 2001 From: Peter Date: Tue, 23 Jul 2024 15:39:09 +0200 Subject: [PATCH] try again fix of #398 --- src/sidebar/search/AddressInput.tsx | 4 +++- src/sidebar/search/AddressInputAutocomplete.tsx | 3 +++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/src/sidebar/search/AddressInput.tsx b/src/sidebar/search/AddressInput.tsx index 315e45eb..a05a8802 100644 --- a/src/sidebar/search/AddressInput.tsx +++ b/src/sidebar/search/AddressInput.tsx @@ -209,7 +209,9 @@ export default function AddressInput(props: AddressInputProps) { setHasFocus(true) props.clearDragDrop() }} - onBlur={() => {}} + onBlur={() => { + if (!isSmallScreen) hideSuggestions() // see #398 + }} value={text} placeholder={tr( type == QueryPointType.From ? 'from_hint' : type == QueryPointType.To ? 'to_hint' : 'via_hint' diff --git a/src/sidebar/search/AddressInputAutocomplete.tsx b/src/sidebar/search/AddressInputAutocomplete.tsx index c850bc46..fcc0131e 100644 --- a/src/sidebar/search/AddressInputAutocomplete.tsx +++ b/src/sidebar/search/AddressInputAutocomplete.tsx @@ -111,6 +111,9 @@ function AutocompleteEntry({ e.preventDefault() // do not forward click to underlying component onSelect() }} + onMouseDown={e => { + e.preventDefault() // prevent blur event for our input, see #398 + }} > {children}