Skip to content

Commit f5baffc

Browse files
authored
Merge pull request #60 from abdel-17/fix-focus-loss
fix: focus lost after pasting
2 parents b6e4202 + e57c6a0 commit f5baffc

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)