From a25f15c9ab53029034f0fb221c72ee6dc28bf265 Mon Sep 17 00:00:00 2001 From: azivner Date: Sun, 27 Aug 2017 10:33:12 -0400 Subject: [PATCH] activating next element in tree after deleting the tree node --- static/js/tree.js | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/static/js/tree.js b/static/js/tree.js index f399de444..ef3239594 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(); } }); }