1
0
mirror of https://github.com/home-assistant/frontend.git synced 2025-12-20 02:38:53 +00:00

Upgrade lazy loaded elements before setting config (#5944)

This commit is contained in:
Bram Kragten
2020-05-20 16:23:50 +02:00
committed by GitHub
parent 300c8d06c4
commit 28d26065e4

View File

@@ -126,6 +126,7 @@ const _lazyCreate = <T extends keyof CreateElementConfigTypes>(
) as CreateElementConfigTypes[T]["element"]; ) as CreateElementConfigTypes[T]["element"];
customElements.whenDefined(tag).then(() => { customElements.whenDefined(tag).then(() => {
try { try {
customElements.upgrade(element);
// @ts-ignore // @ts-ignore
element.setConfig(config); element.setConfig(config);
} catch (err) { } catch (err) {