Skip to content

fix: envelope drag and drop ghost - #13470

Open
madbob wants to merge 1 commit into
nextcloud:mainfrom
madbob:issue_12260
Open

fix: envelope drag and drop ghost#13470
madbob wants to merge 1 commit into
nextcloud:mainfrom
madbob:issue_12260

Conversation

@madbob

@madbob madbob commented Aug 12, 2026

Copy link
Copy Markdown
Collaborator

Fix for the the broken "ghost" element created while dragging an envelope, and colors on dark theme.

Explanation

Commenting out this line, the DOM node used to generate the ghost is not removed and the situation can be examinated. From here, you find that the temporary div is positioned in the top left corner of the screen, and appears already shredded.
Why?
Forcing his background color, it becomes evident: it is placed behind the Nextcloud headers icons!
Eventually, when the DOM element is removed in order to obtain the ghost copy, the browser keeps this exact clip, and the final result appears distorted.
What I have done is to force it above the header with a very high z-index value, so to generate a clean element.

proof

BUT!

A previously existing issue, made even worse by this change, was the visible flash perceptible when the drag starts on the top left corner, exactly caused by the described DOM element created and destroyed with a small delay.
Here I've added also a brief animation intended to make the ghost visible with a delay, intended to reveal it just after all the creation/positioning/deletion process.

That said: the ghost on Firefox is still very transparent, but this is due browser rendering behavior and nothing can be done using just JS and CSS. A completely different approach (e.g. using a new draggable DOM item) is required for a predictable rendering on all browsers.

Fixes #12260

Signed-off-by: Roberto Guido <info@madbob.org>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Drag&Drop preview not readable in dark mode and weird in light mode

1 participant