b-fuze / deno-dom

Browser DOM & HTML parser in Deno
https://jsr.io/@b-fuze/deno-dom
MIT License
426 stars 46 forks source link

Element.className bug #102

Closed oscarotero closed 2 years ago

oscarotero commented 2 years ago

Hi. In the version 0.1.28-alpha the className property doesn't update the value if it was updated previously with classList:

console.log(element.className); // foo
element.classList.add("bar");
console.log(element.className); // foo

In the previous version (v0.1.27-alpha) the className value was successfuly updated to foo bar.

0kku commented 2 years ago

Thanks

oscarotero commented 2 years ago

Thanks for the quick fix. When is planned to tag a new version containing this fix?

b-fuze commented 2 years ago

I'll push it out now, mb

oscarotero commented 2 years ago

Thanks, it works fine now. The only thing is that className now includes a space character:

console.log(element.className); // "" (when it's empty, there's no space)
element.classList.add("bar");
console.log(element.className); // " bar" (has a space in the beginning)
b-fuze commented 2 years ago

Hrm... Yeah, @0kku looks like there's still one more thing

0kku commented 2 years ago

Sigh… I could've sworn I checked for that.

0kku commented 2 years ago

Should be fixed now.

oscarotero commented 2 years ago

It's perfect. Thanks!