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>
@github-actions

Copy link
Copy Markdown

Hello there,
Thank you so much for taking the time and effort to create a pull request to our Nextcloud project.

We hope that the review process is going smooth and is helpful for you. We want to ensure your pull request is reviewed to your satisfaction. If you have a moment, our community management team would very much appreciate your feedback on your experience with this PR review process.

Your feedback is valuable to us as we continuously strive to improve our community developer experience. Please take a moment to complete our short survey by clicking on the following link: https://cloud.nextcloud.com/apps/forms/s/i9Ago4EQRZ7TWxjfmeEpPkf6

Thank you for contributing to Nextcloud and we hope to hear from you soon!

(If you believe you should not receive this message, you can add yourself to the blocklist.)

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