From e1159c472d740bafeb99c57081c0e56dddb8419c Mon Sep 17 00:00:00 2001 From: azivner Date: Thu, 14 Dec 2017 22:53:25 -0500 Subject: [PATCH] better behavior when deleting last item --- public/javascripts/tree_changes.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/public/javascripts/tree_changes.js b/public/javascripts/tree_changes.js index ac6f9bcb3..941419807 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(); }