From 74c41db34b2cc35cbdc5a1865dcf7469f671efbd Mon Sep 17 00:00:00 2001 From: Nariman Jelveh Date: Sat, 24 Oct 2026 17:58:51 -0700 Subject: [PATCH] fix(dashboard): slide a drag back when a read-only folder refuses it A drop a read-only shared folder refused left the drag chip to vanish where it was let go, as if something had happened. It now slides back to where the drag began, as any drop that doesn't land does. --- src/gui/src/UI/Dashboard/TabFiles.js | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/gui/src/UI/Dashboard/TabFiles.js b/src/gui/src/UI/Dashboard/TabFiles.js index 259cb3dbe..089ef4cf7 100644 --- a/src/gui/src/UI/Dashboard/TabFiles.js +++ b/src/gui/src/UI/Dashboard/TabFiles.js @@ -3856,7 +3856,13 @@ const TabFiles = { // obscures the drop target under the cursor. cursorAt: { left: -14, top: -12 }, cursor: 'grabbing', - revert: 'invalid', + // As 'invalid', and also when a folder refused the drop (a + // read-only share), so the chip slides back rather than vanishing. + revert: function (dropped) { + const refused = $(this).data('dropRefused'); + $(this).removeData('dropRefused'); + return ! dropped || !! refused; + }, zIndex: 999999999, scroll: false, distance: 5, @@ -4009,6 +4015,7 @@ const TabFiles = { // would refuse each item. The drag goes back instead. if ( _this.isReadOnlyShare($(el_item).attr('data-path')) ) { ui.helper.data('cancelled', true); + $(ui.draggable).data('dropRefused', true); return; }