feat: block pan on scroll if we are making a selection.

This commit is contained in:
Jack Fishwick
2022-11-22 10:55:06 +00:00
parent 33e730d7b4
commit 707ee19875
@@ -99,7 +99,7 @@ const ZoomPane = ({
useEffect(() => {
if (d3Selection && d3Zoom) {
if (panOnScroll && !zoomActivationKeyPressed) {
if (panOnScroll && !zoomActivationKeyPressed && !userSelectionActive) {
d3Selection.on('wheel.zoom', (event: any) => {
if (isWrappedWithClass(event, noWheelClassName)) {
return false;
@@ -143,6 +143,7 @@ const ZoomPane = ({
}
}
}, [
userSelectionActive,
panOnScroll,
panOnScrollMode,
d3Selection,