darrenjennings / vue-autosuggest

🔍 Vue autosuggest component.
https://darrenjennings.github.io/vue-autosuggest
MIT License
621 stars 91 forks source link

Add touchstart event for updating current index #210

Open tmazeika opened 3 years ago

tmazeika commented 3 years ago

What: Enabling touch simulation in Firefox's Responsive Design Mode, and in Firefox on Android (and possibly iOS), does not select the tapped suggestion item and put its content into the input.

Why: This fixes suggestion item selection in Firefox when used with a touchscreen.

How: There is a newly registered touchstart event handler that does the same thing as onMouseEnter to update the currently selected suggestion item index when a user taps the item. Additionally, touchstart and touchend events handlers are added to the document to make sure that touches select the item if the mouse events did not catch them.

Checklist: