diff --git a/lib/mixins/element-mixin.html b/lib/mixins/element-mixin.html
index 777db15243..d83946cef2 100644
--- a/lib/mixins/element-mixin.html
+++ b/lib/mixins/element-mixin.html
@@ -311,9 +311,9 @@
} else {
template = template.cloneNode(true);
}
- this.prototype._template = template;
}
+ this.prototype._template = template;
}
/**
diff --git a/test/unit/inheritance.html b/test/unit/inheritance.html
index 25c8910427..497bed3b08 100644
--- a/test/unit/inheritance.html
+++ b/test/unit/inheritance.html
@@ -113,6 +113,24 @@
+
+
+
+
@@ -237,6 +255,23 @@
assert.equal(child.handleCustomEvent.callCount, 1);
});
});
+
+ suite('child overriding a template', function() {
+ let el;
+
+ setup(function() {
+ el = document.createElement('child-with-no-template');
+ document.body.appendChild(el);
+ });
+
+ teardown(function() {
+ document.body.removeChild(el);
+ });
+
+ test('returning null nullifies the parent template', function() {
+ assert.isNotOk(el.shadowRoot);
+ });
+ });