Closed bavoco closed 4 months ago
Describe the bug The output of a custom element tagname in innerHTML is null.
To Reproduce
// repro.js import { Window } from "happy-dom"; const win = new Window(); class myCustomElement extends win.HTMLElement {} win.customElements.define("my-custom-element", myCustomElement); win.document.body.append(new myCustomElement()); console.log(win.document.body.innerHTML);
Running node repro.js outputs:
node repro.js
<null></null>
Expected behavior
<my-custom-element></my-custom-element>
Version:
Additional context Interestingly console.log(win.document.body.firstChild.tagName) outputs MY-CUSTOM-ELEMENT
console.log(win.document.body.firstChild.tagName)
MY-CUSTOM-ELEMENT
Thank you for reporting @bavoco! :slightly_smiling_face:
There is a fix in now: https://github.com/capricorn86/happy-dom/releases/tag/v14.3.5
Describe the bug The output of a custom element tagname in innerHTML is null.
To Reproduce
Running
node repro.js
outputs:Expected behavior
Version:
Additional context Interestingly
console.log(win.document.body.firstChild.tagName)
outputsMY-CUSTOM-ELEMENT