mirror of
https://github.com/atom/atom.git
synced 2026-01-26 07:19:06 -05:00
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
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user