We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents 5b06e88 + 874be2f commit e690effCopy full SHA for e690eff
1 file changed
index.js
@@ -258,7 +258,14 @@ AFRAME.registerComponent('environment', {
258
this.environmentData = {};
259
Object.assign(this.environmentData, this.data);
260
Object.assign(this.environmentData, this.presets[this.data.preset]);
261
- Object.assign(this.environmentData, this.el.components.environment.attrValue);
+ // Only assign defined values from attrValue, as removeAttribute sets
262
+ // properties to undefined rather than deleting them.
263
+ var attrValue = this.attrValue;
264
+ for (var key in attrValue) {
265
+ if (attrValue[key] !== undefined) {
266
+ this.environmentData[key] = attrValue[key];
267
+ }
268
269
console.log(this.environmentData);
270
}
271
0 commit comments