[w3c/webcomponents] light dom availability (#673)

I do not think this is the correct place for this question, but if someone could point me in the right direction that would be great. Thanks.

Is there a deterministic approach for querying the light dom of a custom element? In the following example `this.children` is empty in the `console.log`, but the `console.log` wrapped in the `setTimeout` has 2 children.

```javascript
customElements.define('my-element', class MyElement extends HTMLElement {
  constructor() {
    super();        
    const shadowRoot = this.attachShadow({ mode: 'open' });           
  }
  
  connectedCallback() {
    console.log(this.children)
    setTimeout(() => { console.log(this.children); });      
  }
});
```

```html
<my-element>
  <div>First Child</div>
  <div>Second Child</div>
</my-element>
```

-- 
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/673

Received on Monday, 2 October 2017 23:08:05 UTC