Skip to content
Snippets Groups Projects
Commit f4152b0b authored by Reiter, Christoph's avatar Reiter, Christoph :snake:
Browse files

Merge branch 'app-shell-scoped-polyfill' into 'master'

app-shell: Support the new scoped elements registry polyfill

See merge request !50
parents 9869c6a3 93f2e80e
No related branches found
No related tags found
1 merge request!50app-shell: Support the new scoped elements registry polyfill
Pipeline #26793 passed
...@@ -729,7 +729,19 @@ export class AppShell extends ScopedElementsMixin(AdapterLitElement) { ...@@ -729,7 +729,19 @@ export class AppShell extends ScopedElementsMixin(AdapterLitElement) {
this.track('renderActivity', activity.element); this.track('renderActivity', activity.element);
const elm = document.createElement(activity.element); // After it is loaded and registered globally, we get it and register it locally
customElements.whenDefined(activity.element).then(() => {
this.defineScopedElement(activity.element, customElements.get(activity.element));
});
// In case of "Scoped Custom Element Registries" polyfill we create a scoped element
let elm;
if (this.shadowRoot.createElement !== undefined) {
elm = this.shadowRoot.createElement(activity.element);
} else {
elm = document.createElement(activity.element);
}
this._onActivityAdded(elm); this._onActivityAdded(elm);
this._lastElm = elm; this._lastElm = elm;
return elm; return elm;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment