Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a "popup.close" event #2584

Closed
lucaswoj opened this issue May 17, 2016 · 13 comments
Closed

Add a "popup.close" event #2584

lucaswoj opened this issue May 17, 2016 · 13 comments

Comments

@lucaswoj
Copy link
Contributor

Popups should emit an event when they are closed.

@mapsam
Copy link
Contributor

mapsam commented Aug 23, 2016

This is complete!

@mapsam mapsam closed this as completed Aug 23, 2016
@nibygro
Copy link

nibygro commented Oct 27, 2017

Hi @mapsam . How can I listen to it?

    map.on('popup.close', function(e) {
        alert();
    });

doesn't work

@lmikolajczak
Copy link

@nibygro try listen to it this way:

let popup = new mapboxgl.Popup()
popup.on('close', function(e) {
    alert()
})

@nibygro
Copy link

nibygro commented Oct 31, 2017

@Luqqk it works, thanx!

@mapsam
Copy link
Contributor

mapsam commented Nov 1, 2017

Thanks @Luqqk!

@ansarikhurshid786
Copy link

It is working but pupup close event fire twice when open and close.

@kds-snyder
Copy link

I am seeing the same as @ansarikhurshid786; the popup close event fires for a new popup when it is created, if I removed an existing popup before creating the new popup

@styledev
Copy link

I am also seeing popup.on('close', ...) fire on creation, and then twice on close.

@pragsjain
Copy link

@nibygro try listen to it this way:

let popup = new mapboxgl.Popup()
popup.on('close', function(e) {
    alert()
})

not working for me

@Matvik
Copy link

Matvik commented Oct 13, 2020

Same thing, this event fires in wrong time ((((

@alexshk
Copy link

alexshk commented Feb 28, 2022

I am also seeing popup.on('close', ...) fire on creation, and then twice on close too

@hvma411
Copy link

hvma411 commented May 21, 2024

We have 2024 and 'close' event still appears on popup creation 🙄

@yunylz
Copy link

yunylz commented Jun 15, 2024

updates?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests