mapbox / mapbox/mapbox-gl-geocoder
if clearOnBlur:true, relatedTarget returns null when clicking on suggestions list
Nobody has claimed this yet.
- Dominant language
- JavaScript
- Stars
- 388
- Forks
- 181
- PR merge metrics
- No merged PRs in 30d
Description
What I'm trying to do:
- if `clearOnBlur:true`, and the `relatedTarget` on the blur event is the suggestions list, do not clear.
What happens instead:
- in the blur event, relatedTarget is `null` if user clicks on suggestions list.
Why?
- There is an event listener in `suggestions` that removes the suggestions list on selection, before the blur event occurs.
Suggested fix:
- Allow mapbox-gl-geocoder to override the event handling in `suggestions`, or add an option to `suggestions` that does not clear the list on selection.
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
Start by reproducing the blur behavior with clearOnBlur:true while clicking the suggestions list, then inspect the suggestions event listener and the blur event handling described in the issue. Done means selecting a suggestion no longer removes the list before the blur event can use its relatedTarget, while preserving the intended clearOnBlur behavior.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript
- Domain
- frontend
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 40/100