fix: envelope drag and drop ghost - #13470
Open
madbob wants to merge 1 commit into
Open
Conversation
Signed-off-by: Roberto Guido <info@madbob.org>
madbob
requested review from
ChristophWurst,
GretaD and
kesselb
as code owners
August 12, 2026 00:57
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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
divis 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-indexvalue, so to generate a clean element.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