From d0b49fbf1210c08cb9291f122cc0f36b3cc43516 Mon Sep 17 00:00:00 2001 From: jos Date: Mon, 29 Oct 2018 20:28:27 +0100 Subject: [PATCH] Fixed #589 for undo/redo and duplicate actions too --- HISTORY.md | 2 +- src/js/treemode.js | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/HISTORY.md b/HISTORY.md index 86b984c..46f7c2a 100644 --- a/HISTORY.md +++ b/HISTORY.md @@ -10,7 +10,7 @@ https://github.com/josdejong/jsoneditor - Fixed #590: validation failing in code and text mode when status bar is disabled. - Fixed #589: the path in the navigation bar is not updated - when deleting a node. + when duplicating or removing a node, and neither after an undo/redo action. - Fixed duplicate and remove of the action menu of multiple selected nodes not working. - Fixed not preventing default selection of text when selecting nodes. diff --git a/src/js/treemode.js b/src/js/treemode.js index bde7849..07440aa 100644 --- a/src/js/treemode.js +++ b/src/js/treemode.js @@ -500,6 +500,9 @@ treemode._onChange = function () { return; } + // selection can be changed after undo/redo + this.selection = this.getDomSelection(); + // validate JSON schema (if configured) this._debouncedValidate();