From 79de6745081c80feaeb9aeac95caa06f8e8b8667 Mon Sep 17 00:00:00 2001 From: Ryan Holinshead Date: Fri, 13 Jul 2018 16:45:04 -0700 Subject: [PATCH] Currently, the updateClassList function on the TextEditorComponent does not properly re-add its managed classes (editor, is-focused, mini) to the element when the element has been re-rendered with changed classes passed in. This fixes the issue by always adding the newClassList classes to the element and relying on the element.classList.add to determine if the classes already exist (and should be ignored) Released under CC0 --- src/text-editor-component.js | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/src/text-editor-component.js b/src/text-editor-component.js index fdb28ce0e..9b30588e0 100644 --- a/src/text-editor-component.js +++ b/src/text-editor-component.js @@ -848,10 +848,7 @@ class TextEditorComponent { } for (let i = 0; i < newClassList.length; i++) { - const className = newClassList[i] - if (!oldClassList || !oldClassList.includes(className)) { - this.element.classList.add(className) - } + this.element.classList.add(newClassList[i]) } this.classList = newClassList