We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 4d3d03e commit e85a44eCopy full SHA for e85a44e
sites/preview/src/lib/components/Tree.svelte
@@ -3,6 +3,7 @@
3
Tree,
4
type FolderNode,
5
type OnChildrenChangeArgs,
6
+ type OnCircularReferenceArgs,
7
type OnDropDestinationChangeArgs,
8
type OnRemoveArgs,
9
type OnResolveNameConflictArgs,
@@ -52,6 +53,10 @@
52
53
});
54
}
55
56
+ function onCircularReference(args: OnCircularReferenceArgs) {
57
+ toast.error(`Cannot move "${args.source.node.name}" inside itself`);
58
+ }
59
+
60
function canRemove(args: OnRemoveArgs) {
61
return confirmRemoveDialog!.show({
62
title: `Are you sure you want to delete ${args.removed.length} item(s)?`,
@@ -94,6 +99,7 @@
94
99
{onChildrenChange}
95
100
{onDropDestinationChange}
96
101
{onResolveNameConflict}
102
+ {onCircularReference}
97
103
{canRemove}
98
104
class={[
105
"relative grow p-6 focus-visible:outline-2 focus-visible:outline-current",
0 commit comments