Skip to content

Commit 16bf6c2

Browse files
committed
try without onTouchEnd
1 parent 57bee16 commit 16bf6c2

File tree

2 files changed

+8
-7
lines changed

2 files changed

+8
-7
lines changed

src/sidebar/search/AddressInput.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -268,7 +268,7 @@ export default function AddressInput(props: AddressInputProps) {
268268
handlePoiSearch(poiSearch, item.result, props.map)
269269
setText(item.result.text(item.result.poi))
270270
}
271-
searchInput.current!.blur()
271+
searchInput.current!.blur() // is called in combination with e.preventDefault in AutocompleteEntry->onMouseDown
272272
}}
273273
/>
274274
</ResponsiveAutocomplete>

src/sidebar/search/AddressInputAutocomplete.tsx

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -108,15 +108,16 @@ function AutocompleteEntry({
108108
return (
109109
<button
110110
className={className}
111-
// using click events for mouse interaction and touch end to select an entry.
112-
onClick={() => onSelect()}
113-
onTouchEnd={e => {
114-
e.preventDefault() // do not forward click to underlying component
115-
onSelect()
116-
}}
117111
onMouseDown={e => {
118112
e.preventDefault() // prevent blur event for our input, see #398
119113
}}
114+
// using click events for mouse interaction and touch end to select an entry.
115+
onClick={() => onSelect()}
116+
// TODO NOW is this onTouchEnd workaround still required?
117+
// onTouchEnd={e => {
118+
// e.preventDefault() // do not forward click to underlying component
119+
// onSelect()
120+
// }}
120121
>
121122
{children}
122123
</button>

0 commit comments

Comments
 (0)