Popup event firing order is incorrect
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 12.4k
- Forks
- 2.4k
- PR merge metrics
- No merged PRs in 30d
Description
mapbox-gl-js version: v1.11.1
browser: Chrome
Steps to Trigger Behavior
- Create more markers or features with popup
- Add 'open' and 'close' event listeners to the popup
- Click on a marker and then directly to the another one
Link to Demonstration
https://jsbin.com/nelexavuhi/edit?console,output
Expected Behavior
Firstly, close the previous popup (so fire it's close event)
Then open the new one and fire the open event
I don't know if it's a bug or a feature but this order looks correct to me.
Actual Behavior
The close event is after the new open event.
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 with the linked JSBin demonstration and reproduce the popup open/close sequence in Chrome using mapbox-gl-js v1.11.1. Trace the marker click handling and popup event lifecycle, then verify that selecting another marker fires the previous popup's close event before the new popup's open event.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript, typescript
- Domain
- frontend, web-dev
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100