happy-dom
happy-dom copied to clipboard
Order of calls of connectedCallback and attributeChangedCallback is different in happy-dom and browser
Describe the bug When I run the same component in browser first is called attributeChangedCallback and then connectedCallback. Inside happy-dom it's otherwise
To Reproduce Steps to reproduce the behavior:
- Create custom element
- Add observedAttributes, attributeChangedCallback, connectedCallback
- Create element
Minimal repro:
https://github.com/Mighty683/happy-dom-repro
Run dev
and test
check console of both
Expected behavior Order of calls is the same for browser and test environment
Screenshots
Device:
- OS: OSX
- Browser Chrome, Firefox, Happy-Dom
Additional context
I have checked Chrome and Firefox, it seems connected callback is called after. Maybe it's not a bug but connected to setting body by innerHTML
?