fix(dashboard): clear a drop target's highlight after the drop

jQuery UI fires no `out` on drop, so the folder row a selection was
dropped on stayed selected (and went to the Trash with the next Delete),
a sidebar folder stayed highlighted as the current one, and a breadcrumb
kept its drop outline.
This commit is contained in:
Nariman Jelveh committed 2026-10-23 14:13:04 -07:00
1 parent ac0cffe5d9
commit 3bd73a4b3f
1 file changed
+9 -1
+9 -1
View File
@@ -379,6 +379,11 @@ const TabFiles = {
clearTimeout(_this.folderDwellTimer);
_this.folderDwellTimer = null;
_this.folderDwellTarget = null;
// A drop fires no `out`, so undo `over`'s highlight here.
$(folderElement).removeClass('dwell-opening');
if ( folderElement.getAttribute('data-path') !== _this.currentPath ) {
$(folderElement).removeClass('active');
}
// Block if ctrl and trashed
const draggedPath = $(ui.draggable).attr('data-path');
@@ -2527,7 +2532,8 @@ const TabFiles = {
clearTimeout(_this.folderDwellTimer);
_this.folderDwellTimer = null;
_this.folderDwellTarget = null;
$(dirnameElement).removeClass('dwell-opening');
// A drop fires no `out`, so undo `over`'s highlight here.
$(dirnameElement).removeClass('dwell-opening drop-target');
const targetPath = $(this).attr('data-path');
const draggedPath = $(ui.draggable).attr('data-path');
@@ -3484,6 +3490,8 @@ const TabFiles = {
clearTimeout(_this.folderDwellTimer);
_this.folderDwellTimer = null;
_this.folderDwellTarget = null;
// A drop fires no `out`, so undo `over`'s highlight here.
$(el_item).removeClass('selected dwell-opening');
// A row drawn ahead of its mkdir has a predicted path, not
// a real one. Moving into it would either fail or — because