You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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).
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.
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 (
<>
Open React Leaflet
<ReactModal
isOpen={isOpenModal}
onRequestClose={() => setIsOpenModal(false)}
parentSelector={() => document.body}
>
<MapContainer
center={[51.505, -0.09]}
zoom={13}
scrollWheelZoom={false}
style={{
height: '50dvh',
width: '50dvw',
}}
>
</>
);
}
export default App;
`
The text was updated successfully, but these errors were encountered: