Fix map zoom on safari and remove unneeded scroll behaviour setting

This commit is contained in:
Mitchell McCaffrey 2020-04-13 10:33:49 +10:00
parent 974e1d5792
commit df0054eaf6

View File

@ -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;