Skip to content

Commit

Permalink
fix(zoom): allow pinch zoom if preventScrolling=false closes #4101
Browse files Browse the repository at this point in the history
  • Loading branch information
moklick committed Apr 11, 2024
1 parent 0238ba4 commit 782bc7f
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion packages/core/src/container/ZoomPane/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,9 @@ const ZoomPane = ({
d3Selection.on(
'wheel.zoom',
function (this: any, event: any, d: any) {
if (!preventScrolling || isWrappedWithClass(event, noWheelClassName)) {
// we still want to enable pinch zooming even if preventScrolling is set to false
const invalidEvent = !preventScrolling && event.type === 'wheel' && !event.ctrlKey;
if (invalidEvent || isWrappedWithClass(event, noWheelClassName)) {
return null;
}

Expand Down

0 comments on commit 782bc7f

Please sign in to comment.