mirror of
https://github.com/mathuo/dockview
synced 2025-09-15 05:37:59 +00:00
Merge pull request #920 from mathuo/891-first-tab-does-not-drag-drop-when-there-is-not-enough-space-above-the-dockview-area
bug: fix ghost image rendering
This commit is contained in:
commit
f9ca5b99d5
@ -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
|
// class dockview provides to force ghost image to be drawn on a different layer and prevent weird rendering issues
|
||||||
addClasses(ghostElement, 'dv-dragged');
|
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);
|
document.body.appendChild(ghostElement);
|
||||||
dataTransfer.setDragImage(ghostElement, options?.x ?? 0, options?.y ?? 0);
|
dataTransfer.setDragImage(ghostElement, options?.x ?? 0, options?.y ?? 0);
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user