Skip to content

Build your personal knowledge base with Trilium Notes

activating next element in tree after deleting the tree node

azivnera25f15c9ab53
diff --git a/static/js/tree.js b/static/js/tree.js
index f399de4449..ef32395948 100644
--- a/static/js/tree.js
+++ b/static/js/tree.js
@@ -23,7 +23,15 @@ const keybindings = {
// remove from recent notes
recentNotes = recentNotes.filter(note => note !== node.key);
+ let next = node.getNextSibling();
+ if (!next) {
+ next = node.getParent();
+ }
+
node.remove();
+
+ // activate next element after this one is deleted so we don't lose focus
+ next.setActive();
}
});
}