mapbox / mapbox/mapbox-gl-js

Popup event firing order is incorrect

Open
#9,881 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug :lady_beetle:
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
  1. Create more markers or features with popup
  2. Add 'open' and 'close' event listeners to the popup
  3. 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

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.