From f4dc6de9f13ff6d263d24afa6b3771ed2eae0fef Mon Sep 17 00:00:00 2001 From: Penar Musaraj Date: Mon, 8 Jul 2019 20:06:41 -0400 Subject: [PATCH] FIX: Clear theme editor content on switching tabs Issue happens when sending a null value to ACE Editor. Fixed by sending an empty string to ACE instead of null. --- app/assets/javascripts/admin/components/ace-editor.js.es6 | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/app/assets/javascripts/admin/components/ace-editor.js.es6 b/app/assets/javascripts/admin/components/ace-editor.js.es6 index d289d7e47f5..ff3203f9d3d 100644 --- a/app/assets/javascripts/admin/components/ace-editor.js.es6 +++ b/app/assets/javascripts/admin/components/ace-editor.js.es6 @@ -17,8 +17,9 @@ export default Ember.Component.extend({ @observes("content") contentChanged() { - if (this._editor && !this._skipContentChangeEvent && this.content) { - this._editor.getSession().setValue(this.content); + const content = this.content || ""; + if (this._editor && !this._skipContentChangeEvent) { + this._editor.getSession().setValue(content); } },