From 50348e7c5c0e8c267c8a080939e58ba2a0c5e30a Mon Sep 17 00:00:00 2001 From: vcoppe Date: Sat, 31 Oct 2026 14:16:57 +0100 Subject: [PATCH] fix multidrag --- .../src/lib/components/file-list/sortable-file-list.ts | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/website/src/lib/components/file-list/sortable-file-list.ts b/website/src/lib/components/file-list/sortable-file-list.ts index 2a7fe6d7b..580567016 100644 --- a/website/src/lib/components/file-list/sortable-file-list.ts +++ b/website/src/lib/components/file-list/sortable-file-list.ts @@ -79,9 +79,13 @@ export class SortableFileList { setTimeout(() => this.updateToSelection(e), 50), onDeselect: (e: Sortable.SortableEvent) => setTimeout(() => this.updateToSelection(e), 50), - onStart: (e: Sortable.SortableEvent) => { - // all the nodes, not only the elements: the comments are the anchors of the Svelte blocks + onChoose: () => { + // all the nodes, not only the elements: the comments are the anchors of the Svelte + // blocks. Taken before the drag starts, when MultiDrag removes the other selected + // elements from the list. this._snapshot = Array.from(container.childNodes); + }, + onStart: (e: Sortable.SortableEvent) => { dragging.set(sortableLevel); // the files that are dragged (or whose elements are) are open for good engine.keepPreview(this.draggedFiles(e));