Skip to content

Build your personal knowledge base with Trilium Notes

better behavior when deleting last item

azivnere1159c472d74
diff --git a/public/javascripts/tree_changes.js b/public/javascripts/tree_changes.js
index ac6f9bcb3b..9414198074 100644
--- a/public/javascripts/tree_changes.js
+++ b/public/javascripts/tree_changes.js
@@ -66,6 +66,11 @@ const treeChanges = (function() {
}
let next = node.getNextSibling();
+
+ if (!next) {
+ next = node.getPrevSibling();
+ }
+
if (!next) {
next = node.getParent();
}