Fix quick navigation having reexpanding nodes

This commit is contained in:
Magnus Åhall 2026-06-08 21:24:47 +02:00
parent 4976a6ebe0
commit 697576cb34
2 changed files with 7 additions and 6 deletions

View file

@ -429,12 +429,14 @@ export class N2Sidebar extends CustomHTMLElement {
if (!state)
await this.setNodeExpanded(node, false)
}//}}}
async makeVisible(node, providedAncestors) {// {{{
async makeVisible(node, providedAncestors, dontExpand) {// {{{
const treenode = this.treeNodeComponents[node.UUID]
const ancestors = providedAncestors || await nodeStore.getNodeAncestry(node)
for (const ancestor of ancestors.reverse()) {
this.setNodeExpanded(ancestor, true)
if (!dontExpand) {
const ancestors = providedAncestors || await nodeStore.getNodeAncestry(node)
for (const ancestor of ancestors.reverse()) {
this.setNodeExpanded(ancestor, true)
}
}
treenode?.scrollIntoView({ block: 'nearest' })