Replies: 1 comment
-
This is probably just a bug: there are a few bugs in the pointer event handling, and capture doesn't behave at all like the DOM equivalent. See #664 for instance. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
I'm trying to make some controls in my scene to work, that are supposed to act a bit like buttons. For that, I'm tracking the
onPointerOver/Out/Down/Up
events. However, I get issues when the user presses the mouse button on the object, then drags and releases the button outside the object. Depending on whether I have calledsetPointerCapture
in the handler foronPointerDown
, I either don't get theonPointerOut
event (if yes), or I don't get theonPointerUp
event (if not). (See here https://codesandbox.io/s/r3f-event-test-lcc5r?file=/src/App.js, the left cube is with capturing, the right cube without).Is it a bug or is there something I overlooked? The only solution I see currently is to capture the mouse, then track the mouse movement and use the raytracer to generate
onPointerOut
andonPointerOver
events myself, but that seems a bit overly complicated to me, if basically everything is already there in r3f...Beta Was this translation helpful? Give feedback.
All reactions