Skip to content

Commit

Permalink
handle pinch-in/pinch-out on a Mac trackpad
Browse files Browse the repository at this point in the history
  • Loading branch information
bon10 committed Aug 28, 2024
1 parent 8923c51 commit 6efa603
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/SideEffect.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ export function RemoveScrollSideCar(props: IRemoveScrollEffectProps) {
}, [props.inert, props.lockRef.current, props.shards]);

const shouldCancelEvent = React.useCallback((event: WheelEvent | TouchEvent, parent: HTMLElement) => {
if ('touches' in event && event.touches.length === 2) {
if (('touches' in event && event.touches.length === 2) || (event.type === 'wheel' && event.ctrlKey)) {
return !lastProps.current.allowPinchZoom;
}

Expand Down

0 comments on commit 6efa603

Please sign in to comment.