bug: fix ghost image rendering

This commit is contained in:
mathuo 2025-04-29 21:44:55 +01:00
parent 3ddea55834
commit 6d2f2f1012
No known key found for this signature in database
GPG Key ID: C6EEDEFD6CA07281

View File

@ -8,6 +8,9 @@ export function addGhostImage(
// class dockview provides to force ghost image to be drawn on a different layer and prevent weird rendering issues
addClasses(ghostElement, 'dv-dragged');
// move the element off-screen initially otherwise it may in some cases be rendered at (0,0) momentarily
ghostElement.style.top = '-9999px';
document.body.appendChild(ghostElement);
dataTransfer.setDragImage(ghostElement, options?.x ?? 0, options?.y ?? 0);