From 357383bbb823122806f6d7ec398bd885365bd908 Mon Sep 17 00:00:00 2001 From: Ben Flowers Date: Wed, 16 Jun 2021 12:31:05 +0100 Subject: [PATCH] fix: do not capture wheel when pan and zoom disabled --- packages/core/src/EventCapture.tsx | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/packages/core/src/EventCapture.tsx b/packages/core/src/EventCapture.tsx index bed579ae3..f584f7fa2 100644 --- a/packages/core/src/EventCapture.tsx +++ b/packages/core/src/EventCapture.tsx @@ -198,7 +198,12 @@ export class EventCapture extends React.Component { - const { onPan, zoom, onZoom } = this.props; + const { pan, onPan, zoom, onZoom } = this.props; + + if (!pan && !zoom) { + return; + } + const { panInProgress } = this.state; const yZoom = Math.abs(e.deltaY) > Math.abs(e.deltaX) && Math.abs(e.deltaY) > 0;