mapbox / mapbox/mapbox-gl-geocoder
Wrong item selected in autocomplete on chrome android
Nobody has claimed this yet.
- Dominant language
- JavaScript
- Stars
- 388
- Forks
- 181
- PR merge metrics
- No merged PRs in 30d
Description
Hello,
I encountered a weird bug on Android on the autocomplete: when you scroll in your page then click on a suggestion item, the selected item that is put in the field is not the one you pressed on, but the one that was originally at this position before scrolling.
You can easily reproduce that faulty behavior on the official docs example: https://docs.mapbox.com/mapbox-gl-js/example/mapbox-gl-geocoder/
Exact steps:
- start typing in the field
- the autocomplete displays the suggestions
- keep in mind the position of the first result on your screen then scroll a bit to position another result in the same location
- press on the other result
- the first result is selected, not the one you pressed
This doesn't happen in a chrome desktop browser.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Reproduce the issue in the official Mapbox GL Geocoder example on Chrome Android using the listed scroll-and-select steps, then trace the autocomplete suggestion click handling. The fix is done when the item pressed after scrolling is selected, while desktop Chrome behavior remains unchanged.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript
- Domain
- frontend
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100