diff --git a/packages/client/src/components/preview/GridDNDHandler.svelte b/packages/client/src/components/preview/GridDNDHandler.svelte index 62cabc14cd..374defe138 100644 --- a/packages/client/src/components/preview/GridDNDHandler.svelte +++ b/packages/client/src/components/preview/GridDNDHandler.svelte @@ -10,6 +10,15 @@ getGridVarValue, } from "utils/grid" + // Smallest possible 1x1 transparent GIF + const ghost = new Image(1, 1) + ghost.src = + "data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==" + + let dragInfo + let gridStyles = memo() + let id + // Grid CSS variables $: vars = { colStart: $getGridVar("col-start"), @@ -18,10 +27,6 @@ rowEnd: $getGridVar("row-end"), } - let dragInfo - let gridStyles = memo() - let id - // Some memoisation of primitive types for performance $: id = dragInfo?.id || id @@ -117,7 +122,7 @@ } // Hide drag ghost image - e.dataTransfer.setDragImage(new Image(), 0, 0) + e.dataTransfer.setDragImage(ghost, 0, 0) // Extract state let mode, id, side