We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 4639b3b commit 4957b65Copy full SHA for 4957b65
1 file changed
src/hooks/features/image-viewer/useImageDrag.ts
@@ -24,7 +24,12 @@ export function useImageDrag({
24
25
const handleMouseDown = useCallback(
26
(e: React.MouseEvent) => {
27
- if (scale <= minScale) return
+ // Only handle primary button drag when zoomed in
28
+ if (e.button !== 0 || scale <= minScale) return
29
+
30
+ // Prevent browser default drag behavior (e.g., dragging the image/canvas ghost)
31
+ e.preventDefault()
32
33
setIsDragging(true)
34
dragStartRef.current = {
35
x: e.clientX,
0 commit comments