Open 18anandn opened 1 year ago
When you say the Zoom button, do you mean from the map controls? Because there isn't anything in your code snippet that would trigger that behavior. You might want to use the useMapEvent and listen for the end of the Zoom to trigger the stage change for the modal to close.
When you say the Zoom button, do you mean from the map controls? Because there isn't anything in your code snippet that would trigger that behavior. You might want to use the useMapEvent and listen for the end of the Zoom to trigger the stage change for the modal to close.
@cowglow
Yes I mean the zoom button provided by react-leaflet by default. If I use touchpad or keyboard (ctrl and +) to zoom then this problem does not arise.
Bug report in v4
Expected behavior
After clicking on the zoom button, modal closes when clicked on overlay on first click.
Actual behavior
After clicking on the zoom button, modal does not close when clicked on overlay on first click. It takes 2 clicks. It works as expected with every other interaction (like click inside modal content or map, scroll zoom).
Steps to reproduce
Dependencies:
{ "leaflet": "^1.9.4", "react": "^18.2.0", "react-dom": "^18.2.0", "react-leaflet": "^4.2.1", "react-modal": "^3.16.1" }
Code to reproduce: ` import { useState } from 'react'; import ReactModal from 'react-modal'; import { MapContainer } from 'react-leaflet/MapContainer'; import { TileLayer } from 'react-leaflet/TileLayer';
function App() { const [isOpenModal, setIsOpenModal] = useState(false);
const handleClick = () => { setIsOpenModal(true); };
return ( <>
); }
export default App; `