fix hover state by emitting mouseleave when option is no longer active (fixes #1)

This commit is contained in:
Kevin Ngo
2018-09-18 01:53:05 -07:00
parent 94edcdb1d0
commit 08334b16ef
2 changed files with 4 additions and 1 deletions

View File

@@ -19,6 +19,9 @@ AFRAME.registerComponent('active-color', {
el.setAttribute('material', 'color', this.data.color);
} else {
el.setAttribute('material', 'color', this.defaultColor);
if (el.components.animation__mouseleave) {
setTimeout(() => { el.emit('mouseleave', null, false); });
}
}
},
});