Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

> you have to explicitly specify mode: open

The mode does not toggle the shadow DOM on and off. It just specifies whether or not the element's shadowRoot object is a public property. An open mode makes this possible: `document.querySelector('my-component').shadowRoot`.

You have to explicitly opt-in to the shadow DOM either imperatively by calling `attachShadow`, or declaratively in HTML by giving the element a template child element with a `shadowrootmode` attribute.



I stand corrected!




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: