Skip to content

Commit 45cda45

Browse files
authored
fix: Make right clicking no longer drag images in the image viewer (#620)
### Description As per typical UX conventions, right clicking no longer drags images in the image preview. Fixes #555 #### Type of change - [x] Bug fix (non-breaking change which fixes an issue) - [ ] New feature (non-breaking change which adds functionality) - [ ] Breaking change (fix or feature that would cause existing functionality to not work as expected) - [ ] This change requires a documentation update ### Checklist: - [x] My code follows the style guidelines of this project - [x] I have performed a self-review of my own code - [ ] I have commented my code, particularly in hard-to-understand areas - [ ] I have made corresponding changes to the documentation - [x] My changes generate no new warnings ### AI disclosure: - [ ] Partially AI assisted (clarify which code was AI assisted and briefly explain what it does). - [ ] Fully AI generated (explain what all the generated code does in moderate detail).
2 parents ab80d33 + 2e5663b commit 45cda45

2 files changed

Lines changed: 6 additions & 1 deletion

File tree

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
default: patch
3+
---
4+
5+
Right clicks no longer drag images in the viewer.

src/app/hooks/useImageGestures.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ export const useImageGestures = (active: boolean, step = 0.2, min = 0.1, max = 5
7474

7575
const onPointerDown = useCallback(
7676
(e: React.PointerEvent) => {
77-
if (!active) return;
77+
if (!active || (e.pointerType === 'mouse' && e.button === 2)) return;
7878

7979
e.stopPropagation();
8080
const target = e.target as HTMLElement;

0 commit comments

Comments
 (0)