Fix map zoom on safari and remove unneeded scroll behaviour setting
This commit is contained in:
parent
974e1d5792
commit
df0054eaf6
@ -80,11 +80,9 @@ function Map({
|
||||
const mapContainer = mapContainerRef.current;
|
||||
|
||||
function handleZoom(event) {
|
||||
// Stop the trackpad zoom event from zooming the
|
||||
// webpage when in the map
|
||||
if (event.ctrlKey) {
|
||||
event.preventDefault();
|
||||
}
|
||||
// Stop overscroll on chrome and safari
|
||||
// also stop pinch to zoom on chrome
|
||||
event.preventDefault();
|
||||
|
||||
const deltaY = event.deltaY * zoomSpeed;
|
||||
setMapScale((previousMapScale) =>
|
||||
@ -105,16 +103,6 @@ function Map({
|
||||
};
|
||||
}, []);
|
||||
|
||||
// Stop the overscroll when the map is loaded and restore it when
|
||||
// unmounted
|
||||
useEffect(() => {
|
||||
document.body.style.overscrollBehavior = "none";
|
||||
|
||||
return () => {
|
||||
document.body.style.overscrollBehavior = "initial";
|
||||
};
|
||||
}, []);
|
||||
|
||||
const mapRef = useRef(null);
|
||||
const mapContainerRef = useRef();
|
||||
const rows = mapData && mapData.rows;
|
||||
|
Loading…
Reference in New Issue
Block a user