happy-dom icon indicating copy to clipboard operation
happy-dom copied to clipboard

Order of calls of connectedCallback and attributeChangedCallback is different in happy-dom and browser

Open Mighty683 opened this issue 11 months ago • 0 comments

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:

  1. Create custom element
  2. Add observedAttributes, attributeChangedCallback, connectedCallback
  3. 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 obraz obraz

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?

Mighty683 avatar Mar 15 '24 16:03 Mighty683