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

Closing a PopUp calls window.onpopstate #8203

Closed
eliboni opened this issue May 1, 2022 · 1 comment
Closed

Closing a PopUp calls window.onpopstate #8203

eliboni opened this issue May 1, 2022 · 1 comment

Comments

@eliboni
Copy link

eliboni commented May 1, 2022

Steps to reproduce
https://leafletjs.com/examples/quick-start/example.html

add

window.onpopstate = function(event) { console.log(event); console.log("onpopstate"); };

see attached

Expected behavior
window.onpopstate should not be called when a popup is closed (click on x on top-right of the popup), at least this is the behavior I would expect, if I am wrong let me know

Current behavior
window.onpopstate is called when popup is closed.

Environment

  • Leaflet version: 1.8.0
  • Browser (with version): tested on Firefox, Safari
  • OS/Platform (with version): Linux / Ipad

Please create an example using https://leafletjs.com/edit.html or any other jsfiddle-like site.

https://plnkr.co/edit/jZYUUuMVaGkmreIt

@IvanSanchez
Copy link
Member

Duplicate of #8159 . Preventing the event's default behaviour (as done in #8160) should avoid the change in the window state.

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

No branches or pull requests

2 participants