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

"X" mark in popup is breaking applications by pointing to "#close" #8235

Closed
5 tasks done
hadson172 opened this issue May 11, 2022 · 1 comment
Closed
5 tasks done

Comments

@hadson172
Copy link

  • I've looked at the documentation to make sure the behavior is documented and expected
  • I'm sure this is a Leaflet code issue, not an issue with my own code nor with the framework I'm using (Cordova, Ionic, Angular, React…)
  • I've searched through the issues to make sure it's not yet reported

Steps to reproduce
Steps to reproduce the behavior:

The "X" mark is a link, when click will redirect app to diffrent url (like this)
https://leafletjs.com/#close

The button is rendered as <a class="leaflet-popup-close-button" role="button" aria-label="Close popup" href="#close"><span aria-hidden="true">×</span></a>

Expected behavior
Leaflet close popup button should not mess with routing inside application and create links pointing to sections.

Current behavior
In case of leaflet with frameworks like react and react-router this feature is breaking routing, enforcing to trigger hooks watching url changes and forcing to re-render whole map and page.

Environment

  • Leaflet version: 1.8.0
  • Browser (with version): Firefox
  • OS/Platform (with version): Windows

Additional context

Minimal example reproducing the issue

https://leafletjs.com/

  • this example is as simple as possible
  • this example does not rely on any third party code
@hadson172 hadson172 changed the title "X" mark in popup is breaking application by pointing to "#close" "X" mark in popup is breaking applications by pointing to "#close" May 11, 2022
@IvanSanchez
Copy link
Member

Duplicate of #8159

@IvanSanchez IvanSanchez marked this as a duplicate of #8159 May 12, 2022
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