t2ym / i18n-element

I18N Base Element for Lit and Polymer
Other
9 stars 1 forks source link

Imperatively created elements have no shadowRoot #1

Closed t2ym closed 7 years ago

t2ym commented 7 years ago

Imperatively created elements (i18n-preference, i18n-attr-repo) via document.createElement() have no shadowRoot after they are attached to HTML document.

If <i18n-preference> is declaratively attached to HTML document, the element has its own shadowRoot from <dom-module> expectedly.

It seems static get template() of Polymer.Element is called when static get is() is not set.

Looking into when and how to call static get template() appropriately. Is this a bug in Polymer 2.0-preview?

t2ym commented 7 years ago

Template registration and initialization are asynchronous in Polymer 2.x

Imperative and synchronous registration and pre-attachment are required for earlier initialization.