diff --git a/static/js/sidebar.mjs b/static/js/sidebar.mjs index 285fd44..da05750 100644 --- a/static/js/sidebar.mjs +++ b/static/js/sidebar.mjs @@ -346,7 +346,8 @@ export class N2Sidebar extends CustomHTMLElement { } if (siblingBefore !== null && siblingExpanded && siblingBefore.hasChildren()) { - _mbus.dispatch("GO_TO_NODE", { nodeUUID: siblingBefore.Children[siblingBefore.Children.length - 1]?.UUID, dontPush: false, dontExpand: true }) + const nodeVisuallyAbove = this.getLastExpandedNode(siblingBefore) + _mbus.dispatch("GO_TO_NODE", { nodeUUID: nodeVisuallyAbove.UUID, dontPush: false, dontExpand: true }) return }