diff --git a/src/components/ha-sidebar.html b/src/components/ha-sidebar.html
index edb24d593c..195c2aa1ff 100644
--- a/src/components/ha-sidebar.html
+++ b/src/components/ha-sidebar.html
@@ -93,6 +93,10 @@
padding: 0 8px;
opacity: var(--dark-secondary-opacity);
}
+
+ dom-if {
+ display: none;
+ }
diff --git a/src/state-summary/state-card-script.html b/src/state-summary/state-card-script.html
index b28b1263ff..f6a7023d36 100644
--- a/src/state-summary/state-card-script.html
+++ b/src/state-summary/state-card-script.html
@@ -22,6 +22,10 @@
ha-entity-toggle {
margin-left: 16px;
}
+
+ dom-if {
+ display: none;
+ }
diff --git a/src/util/hass-util.html b/src/util/hass-util.html
index ddcd320645..f9fe871589 100644
--- a/src/util/hass-util.html
+++ b/src/util/hass-util.html
@@ -106,9 +106,15 @@ window.hassUtil.dynamicContentUpdater = function (root, newElementTag, attribute
customEl = document.createElement(newElementTag);
}
- Object.keys(attributes).forEach(function (key) {
- customEl[key] = attributes[key];
- });
+ if (customEl.setProperties) {
+ customEl.setProperties(attributes);
+ } else {
+ // If custom element definition wasn't loaded yet - setProperties would be
+ // missing, but no harm in setting attributes one-by-one then.
+ Object.keys(attributes).forEach((key) => {
+ customEl[key] = attributes[key];
+ });
+ }
if (customEl.parentNode === null) {
rootEl.appendChild(customEl);