From 1642d9384401b14ce3a12872e4821ce0456ffcb7 Mon Sep 17 00:00:00 2001 From: EricRovell Date: Mon, 30 Oct 2023 12:26:52 +0300 Subject: [PATCH] fix: firefox draggable image bug --- src/lib/actions/pannable.ts | 2 ++ src/lib/layout/gallery/gallery.layout.svelte | 1 + 2 files changed, 3 insertions(+) diff --git a/src/lib/actions/pannable.ts b/src/lib/actions/pannable.ts index 59348aaf..ddde29d6 100644 --- a/src/lib/actions/pannable.ts +++ b/src/lib/actions/pannable.ts @@ -17,6 +17,7 @@ export const pannable: Action = (node) => { function handleMousedown(event: MouseEvent) { node.style.cursor = "all-scroll"; + node.setAttribute("draggable", "false"); node.dispatchEvent(new CustomEvent("panstart", { detail: { x: event.clientX, @@ -72,6 +73,7 @@ export const pannable: Action = (node) => { recenter(); node.style.cursor = "unset"; + node.removeAttribute("draggable"); node.dispatchEvent(new CustomEvent("panend", { detail: { x: event.clientX, diff --git a/src/lib/layout/gallery/gallery.layout.svelte b/src/lib/layout/gallery/gallery.layout.svelte index cd40fed7..84eb6747 100644 --- a/src/lib/layout/gallery/gallery.layout.svelte +++ b/src/lib/layout/gallery/gallery.layout.svelte @@ -199,5 +199,6 @@ width={fullsize.width} height={fullsize.height} alt={description} + draggable="false" />