From 73289bca6d4e326de4484e991019e10f69a351ed Mon Sep 17 00:00:00 2001 From: Andrey Date: Tue, 12 Sep 2017 06:12:40 +0300 Subject: [PATCH] Fix customize config panel on FF (#425) --- panels/config/customize/ha-customize-attribute.html | 4 +++- src/util/hass-util.html | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/panels/config/customize/ha-customize-attribute.html b/panels/config/customize/ha-customize-attribute.html index 8cd93e270b..f4e4c0ee68 100644 --- a/panels/config/customize/ha-customize-attribute.html +++ b/panels/config/customize/ha-customize-attribute.html @@ -68,7 +68,9 @@ class HaCustomizeAttribute extends Polymer.Element { if (wrapper.lastChild) { wrapper.removeChild(wrapper.lastChild); } - this.$.child = child = document.createElement(tag); + // Creating an element with upper case works fine in Chrome, but in FF it doesn't immediately + // become a defined Custom Element. Polymer does that in some later pass. + this.$.child = child = document.createElement(tag.toLowerCase()); child.className = 'form-control'; child.addEventListener('item-changed', () => { this.item = Object.assign({}, child.item); diff --git a/src/util/hass-util.html b/src/util/hass-util.html index 5022b9cf0c..7a191001e3 100755 --- a/src/util/hass-util.html +++ b/src/util/hass-util.html @@ -97,7 +97,9 @@ window.hassUtil.dynamicContentUpdater = function (root, newElementTag, attribute if (rootEl.lastChild) { rootEl.removeChild(rootEl.lastChild); } - customEl = document.createElement(newElementTag); + // Creating an element with upper case works fine in Chrome, but in FF it doesn't immediately + // become a defined Custom Element. Polymer does that in some later pass. + customEl = document.createElement(newElementTag.toLowerCase()); } if (customEl.setProperties) {