From 6e0ac52a64e14ba7d6a346799c886d27d2dcf43f Mon Sep 17 00:00:00 2001 From: Aakansha Doshi Date: Mon, 18 Jul 2022 14:39:55 +0530 Subject: [PATCH] fix: check for ctrl key when wheel event triggered to only disable zooming (#5459) * fix: check for ctrl key when wheel event triggered to only disable zooming * remove newline --- src/components/App.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/components/App.tsx b/src/components/App.tsx index 0fe8319ec..271f1ac4d 100644 --- a/src/components/App.tsx +++ b/src/components/App.tsx @@ -1959,9 +1959,9 @@ class App extends React.Component { }, ); - private onWheel = withBatchedUpdates((event: MouseEvent) => { + private onWheel = withBatchedUpdates((event: WheelEvent) => { // prevent browser pinch zoom on DOM elements - if (!(event.target instanceof HTMLCanvasElement)) { + if (!(event.target instanceof HTMLCanvasElement) && event.ctrlKey) { event.preventDefault(); } });