Skip to content

Commit c1b6286

Browse files
committed
fix: reset on drop
1 parent 41943f0 commit c1b6286

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

lib/HeTree.tsx

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -482,12 +482,12 @@ export function useHeTree<T extends Record<string, any>>(
482482
if (isExternal && !props.onExternalDragOver?.(e)) {
483483
return
484484
}
485-
// let customized = false
486485
if (placeholder) {
487486
e.preventDefault();
488487
if (isExternal) {
489488
const { index: targetIndexInSiblings } = placeholder
490489
props.onExternalDrop?.(e, placeholder.parentStat, targetIndexInSiblings, isExternal)
490+
reset()
491491
}
492492
}
493493
}
@@ -537,6 +537,9 @@ export function useHeTree<T extends Record<string, any>>(
537537
}
538538
props.onChange!(newData)
539539
}
540+
reset()
541+
}
542+
function reset() {
540543
setDragOverStat(undefined);
541544
setDraggedStat(undefined);
542545
setPlaceholder(undefined);

0 commit comments

Comments
 (0)