Skip to content

Commit a6586c9

Browse files
committed
fix(tree): keep moved notes always visible
1 parent 64a756c commit a6586c9

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

apps/client/src/widgets/note_tree.ts

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1606,27 +1606,29 @@ export default class NoteTreeWidget extends NoteContextAwareWidget {
16061606
return !parentNote?.hasLabel("sorted");
16071607
}
16081608

1609-
moveNoteUpCommand({ node }: CommandListenerData<"moveNoteUp">) {
1609+
async moveNoteUpCommand({ node }: CommandListenerData<"moveNoteUp">) {
16101610
if (!node || !this.canBeMovedUpOrDown(node)) {
16111611
return;
16121612
}
16131613

16141614
const beforeNode = node.getPrevSibling();
16151615

16161616
if (beforeNode !== null) {
1617-
branchService.moveBeforeBranch([node.data.branchId], beforeNode.data.branchId);
1617+
await branchService.moveBeforeBranch([node.data.branchId], beforeNode.data.branchId);
1618+
node.makeVisible({ scrollIntoView: true });
16181619
}
16191620
}
16201621

1621-
moveNoteDownCommand({ node }: CommandListenerData<"moveNoteDown">) {
1622+
async moveNoteDownCommand({ node }: CommandListenerData<"moveNoteDown">) {
16221623
if (!this.canBeMovedUpOrDown(node)) {
16231624
return;
16241625
}
16251626

16261627
const afterNode = node.getNextSibling();
16271628

16281629
if (afterNode !== null) {
1629-
branchService.moveAfterBranch([node.data.branchId], afterNode.data.branchId);
1630+
await branchService.moveAfterBranch([node.data.branchId], afterNode.data.branchId);
1631+
node.makeVisible({ scrollIntoView: true });
16301632
}
16311633
}
16321634

0 commit comments

Comments
 (0)