diff --git a/src/core/a-entity.js b/src/core/a-entity.js index 62ce484f8dc..bbb9324b179 100644 --- a/src/core/a-entity.js +++ b/src/core/a-entity.js @@ -379,6 +379,10 @@ class AEntity extends ANode { if (destroy) { component.destroy(); delete this.components[name]; + // Remove attribute from DOM, if still present + if (this.hasAttribute(name)) { + window.HTMLElement.prototype.removeAttribute.call(this, name); + } } this.emit('componentremoved', component.evtDetail, false); diff --git a/tests/core/a-mixin.test.js b/tests/core/a-mixin.test.js index 2d3343e0319..26745251596 100644 --- a/tests/core/a-mixin.test.js +++ b/tests/core/a-mixin.test.js @@ -97,7 +97,7 @@ suite('a-mixin', function () { testEl.setAttribute('delete-mixin', ''); testEl.addEventListener('loaded', function () { assert.equal(testEl.getAttribute('mixin'), null); - assert.equal(testEl.getAttribute('material'), ''); + assert.equal(testEl.getAttribute('material'), null); done(); }); el.sceneEl.appendChild(testEl);