react-leaflet icon indicating copy to clipboard operation
react-leaflet copied to clipboard

Map resets its zoom after closing the marker popup

Open Glebka opened this issue 1 year ago • 1 comments

Bug report in v4

Before opening an issue, make sure to read the contributing guide and understand this is a bug tracker, not a support platform.

Please make sure to check the following boxes before submitting an issue.
Issues opened without using this template will be closed unless they have a good reason not to follow this template.

  • [x] All peer dependencies are installed: React, ReactDOM and Leaflet.
  • [x] Using the latest version of React and ReactDOM v18.
  • [x] Using the supported version of Leaflet (v1.8.0 minimum) and its corresponding CSS file is loaded.
  • [x] Using the latest v4 version of React-Leaflet.
  • [x] The issue has not already been reported.
  • [x] Make sure you have followed the quick start guide for Leaflet.
  • [x] Make sure you have fully read the documentation and that you understand the limitations.

Expected behavior

When closing popup with X button - the map doesn't reset zoom

Actual behavior

When closing popup with X button - the map does reset zoom

Steps to reproduce

  1. Open https://react-leaflet.js.org/
  2. Scroll down the page to the map example
  3. Zoom in or zoom out several times
  4. Click on marker
  5. Click on X button on the popup
  6. Observe that map did reset zoom

Glebka avatar Jul 06 '22 16:07 Glebka

Same here. It redirects to #close and triggers a rerender of a page. This is really annoying.

leaflet-marker-close

pyrozhok avatar Jul 12 '22 16:07 pyrozhok

This is Leaflet's behavior, not something caused by React Leaflet.

PaulLeCam avatar Aug 06 '22 11:08 PaulLeCam