Skip to content

Commit e57c6a0

Browse files
committed
fix: focus lost after pasting
1 parent b6e4202 commit e57c6a0

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

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

+5
Original file line numberDiff line numberDiff line change
@@ -640,6 +640,11 @@ export function createTreeState<TData extends FileTreeNodeData>({
640640

641641
if (didPaste) {
642642
clearClipboard();
643+
644+
// After pasting, the order of the items changes, which may cause focus
645+
// to be lost.
646+
// https://github.com/sveltejs/svelte/issues/15634
647+
getItemElement(target.node.id)?.focus();
643648
}
644649

645650
return didPaste;

0 commit comments

Comments
 (0)