Skip to content

Commit

Permalink
fix: firefox draggable image bug
Browse files Browse the repository at this point in the history
  • Loading branch information
EricRovell committed Oct 30, 2023
1 parent b63babd commit 1642d93
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/lib/actions/pannable.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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,
Expand Down
1 change: 1 addition & 0 deletions src/lib/layout/gallery/gallery.layout.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -199,5 +199,6 @@
width={fullsize.width}
height={fullsize.height}
alt={description}
draggable="false"
/>
</ImageFullscreen>

0 comments on commit 1642d93

Please sign in to comment.