1
0
mirror of https://github.com/excalidraw/excalidraw.git synced 2024-11-10 11:35:52 +01:00

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
This commit is contained in:
Aakansha Doshi 2022-07-18 14:39:55 +05:30 committed by GitHub
parent 5bc40402a6
commit 6e0ac52a64
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -1959,9 +1959,9 @@ class App extends React.Component<AppProps, AppState> {
},
);
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();
}
});