Skip to content

Commit

Permalink
fix(zoom): ignore context menu pointer events
Browse files Browse the repository at this point in the history
  • Loading branch information
igordanchenko committed Aug 17, 2024
1 parent 54a7431 commit 23f1f49
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/plugins/zoom/hooks/useZoomSensors.ts
Original file line number Diff line number Diff line change
Expand Up @@ -132,8 +132,12 @@ export function useZoomSensors(
const onPointerDown = useEventCallback((event: React.PointerEvent) => {
const pointers = activePointers.current;

// ignore clicks outside current slide (zoom icons, navigation buttons, etc.)
if (!zoomWrapperRef?.current?.contains(event.target as unknown as Element)) {
if (
// ignore right button clicks (e.g., context menu)
(event.pointerType === "mouse" && event.buttons > 1) ||
// ignore clicks outside current slide (zoom icons, navigation buttons, etc.)
!zoomWrapperRef?.current?.contains(event.target as unknown as Element)
) {
return;
}

Expand Down

0 comments on commit 23f1f49

Please sign in to comment.