diff --git a/lib/utils/templatize.html b/lib/utils/templatize.html index c4290724e2..96e63cdc77 100644 --- a/lib/utils/templatize.html +++ b/lib/utils/templatize.html @@ -165,6 +165,18 @@ } else { n.textContent = n.__polymerTextContent__; } + // remove and replace slot + } else if (n.localName === 'slot') { + if (hide) { + n.__polymerParent__ = n.parentNode; + n.__polymerSibling__ = n.nextSibling; + n.parentNode.removeChild(n); + } else { + const parent = n.__polymerParent__; + if (parent) { + parent.insertBefore(n, n.__polymerSibling__ || null); + } + } } else if (n.style) { if (hide) { n.__polymerDisplay__ = n.style.display; diff --git a/test/unit/dom-if-elements.html b/test/unit/dom-if-elements.html index f6d39dac84..ea877ef653 100644 --- a/test/unit/dom-if-elements.html +++ b/test/unit/dom-if-elements.html @@ -190,6 +190,28 @@ + + + + +