Skip to content

Commit 079090c

Browse files
committed
fix: delete item even if not selected
1 parent c1cb9e4 commit 079090c

File tree

1 file changed

+4
-1
lines changed
  • packages/svelte-file-tree/src/lib/components

1 file changed

+4
-1
lines changed

packages/svelte-file-tree/src/lib/components/Tree.svelte

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -520,8 +520,11 @@
520520
focusTarget = nearestUnselected;
521521
}
522522
523+
const node = item.node;
523524
for (const owner of removedOwners) {
524-
owner.children = owner.children.filter((child) => !selectedIds.has(child.id));
525+
owner.children = owner.children.filter(
526+
(child) => !selectedIds.has(child.id) && child !== node,
527+
);
525528
onChildrenChange({
526529
operation: "remove",
527530
target: owner,

0 commit comments

Comments
 (0)