Re: [w3c/webcomponents] Empty innerHTML/textContent in connectedCallback, but the actual content is rendered (#903)

Can you elaborate on _``setTimeout`` is absolutely the wrong approach_

Doesn't ``setTimeout`` ensure code is run when the Eventloop is done/empty?

If the objective is to access (light)DOM content from the ``connectedCallback``;  
**can** ``setTimeout`` code run **too early**?

````
<my-element>Hello </my-element>
...
connectedCallback(){
  setTimeout(()=>{
   this.innerHTML = this.innerHTML + "World!"
  }
}
````


-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/w3c/webcomponents/issues/903#issuecomment-717835179

Received on Wednesday, 28 October 2020 10:17:44 UTC