Controls break events due to stopPropagation
See original GitHub issuefor reference: https://github.com/pmndrs/drei/issues/171
function onMouseDown( event ) {
event.preventDefault();
event.stopPropagation();
https://github.com/mrdoob/three.js/blob/dev/examples/jsm/controls/TrackballControls.js
three jsm controls take away the users ability to raycast properly or use events in general, because events are stopped by the control. depending on what the user does, our own event either work, work sometimes, or don’t work at all. it is a race condition, which is more dangerous for app stability.
imo preventdefault and especially stoppropagation in a control is a bad idea. i read a little back and found what made you merge it, it appeared to fix some problem but even the authors back then admitted it was an accidental hack (due to the race condition) and would like to remove it. they saw an issue fixed, but now caused a problem for everything else that uses events.
but as it stands, if any control is used, they take over and prevent the user from interacting with the scene.
Issue Analytics
- State:
- Created 3 years ago
- Comments:14 (10 by maintainers)
Top GitHub Comments
it is still broken it seems. i think the problem really is preventdefault. you can see it here: https://codesandbox.io/s/focused-paper-fme44?file=/src/App.js ref: https://github.com/pmndrs/three-stdlib/issues/61
once orbitcontrols are present outer events are broken. if i comment out preventdefault it works. i still think it should not be [orbit]controls responsibility to handle browser defaults but the users.
Merged. Lets see how it goes 👍