You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
When an element class is removed it can magically come back after adding a new name to the class list.
To Reproduce
Steps to reproduce the behavior:
constelem=document.createElement("div");elem.classList.add("foo","bar","baz");expect(elem.outerHTML).toEqual("<div class=\"foo bar baz\"></div>");elem.className="";elem.classList.add("bar","baz");expect(elem.outerHTML).toEqual("<div class=\"bar baz\"></div>");
run the above code and see it fail, the actual html of elem.outerHTML has the foo class name
Expected behavior
class names should not re-appear after being removed
Screenshots
Device:
OS: [e.g. iOS]
Browser [e.g. chrome, safari]
Version [e.g. 22] 17.4.6
Additional context
I've done some debugging and to me it seems like the cached value of the class attribute is incorrect (the cache.attributeValue is an empty string but the cache.items has the old entries in it. (see above screenshot)
The text was updated successfully, but these errors were encountered:
Uh oh!
There was an error while loading. Please reload this page.
Describe the bug
When an element class is removed it can magically come back after adding a new name to the class list.
To Reproduce
Steps to reproduce the behavior:
run the above code and see it fail, the actual html of
elem.outerHTML
has thefoo
class nameExpected behavior
class names should not re-appear after being removed
Screenshots


Device:
Additional context
I've done some debugging and to me it seems like the cached value of the class attribute is incorrect (the
cache.attributeValue
is an empty string but thecache.items
has the old entries in it. (see above screenshot)The text was updated successfully, but these errors were encountered: