fix: envelope drag and drop ghost - #13470
Conversation
Signed-off-by: Roberto Guido <info@madbob.org>
|
Hello there, 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.) |
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