Closed eng1neer closed 7 years ago
This was filed a couple days ago. Closed with solution at https://github.com/aframevr/aframe/issues/2708
@ngokevin I just think that this is not a corner or a rare case - changing a class name of an element so that it triggers (or does not trigger) a selector match. Why not do an extended check in the raycaster component (maybe just reacting on "class" attribute changes)? Is it a performance consideration?
It's expensive. Better to call the refresh method on demand rather than hacking in mutation observers and running selector refreshes 90 times per second.
If you really want to do it, you can create a component that force refreshes the raycaster on your desired interval.
I have a use case where an object is switching from selectable to a non-selectable state. I do this by changing the class name from 'screen selectable' to just 'screen' (raycaster is set up with '.selectable' selector).
It appears that the raycaster component does not react to class name changes, it only detects a change when an element is added or removed from DOM.