diff --git a/HISTORY.md b/HISTORY.md index 8cfa66f..3ec3055 100644 --- a/HISTORY.md +++ b/HISTORY.md @@ -5,6 +5,8 @@ https://github.com/josdejong/jsoneditor ## not yet released, version 5.5.5 +- Fixed #298: Switch mode button disappears when switching from text/code to + tree/form/view mode when the JSON contained errors. - Fixed enum drop downs not working when the JSONEditor is configured with a name. diff --git a/src/js/textmode.js b/src/js/textmode.js index 15d3689..91a5741 100644 --- a/src/js/textmode.js +++ b/src/js/textmode.js @@ -126,8 +126,6 @@ textmode.create = function (container, options) { // create mode box if (this.options && this.options.modes && this.options.modes.length) { this.modeSwitcher = new ModeSwitcher(this.menu, this.options.modes, this.options.mode, function onSwitch(mode) { - me.modeSwitcher.destroy(); - // switch mode and restore focus me.setMode(mode); me.modeSwitcher.focus();