Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

v9: pointer events don't work with primitives #3437

Closed
vinkovsky opened this issue Jan 28, 2025 · 17 comments · Fixed by #3439
Closed

v9: pointer events don't work with primitives #3437

vinkovsky opened this issue Jan 28, 2025 · 17 comments · Fixed by #3439
Labels
bug Something isn't working

Comments

@vinkovsky
Copy link

i noticed that events on primitives are broken. Not firing at all

    const { scene } = useGLTF(path);
    <primitive
      object={scene}
      onDoubleClick={onDoubleClick}
      onPointerDown={onPointerDown}
      onPointerMissed={onPointerMissed}
    />

example

https://codesandbox.io/p/sandbox/inspiring-hawking-jnylxj
https://jnylxj.csb.app/

@CodyJasonBennett CodyJasonBennett added the bug Something isn't working label Jan 28, 2025
@CodyJasonBennett CodyJasonBennett linked a pull request Jan 29, 2025 that will close this issue
@vinkovsky
Copy link
Author

Hello @CodyJasonBennett ! Thanks for the quick fix. Can I ask you when you plan to release it?

@CodyJasonBennett
Copy link
Member

This is now fixed with 9.0.0-rc.6.

@vinkovsky
Copy link
Author

@CodyJasonBennett thank you!

@vinkovsky
Copy link
Author

@CodyJasonBennett sorry, but it didnt work :(

Here is my code
pointer-issue.zip

@CodyJasonBennett
Copy link
Member

Does it work with: "@react-three/fiber": "https://pkg.csb.dev/pmndrs/react-three-fiber/commit/8ecfbc58/@react-three/fiber"? Maybe I released the wrong build.

@vinkovsky
Copy link
Author

Give me a minute. I'll check

@vinkovsky
Copy link
Author

vinkovsky commented Feb 4, 2025

@CodyJasonBennett Unfortunately it doesnt. In packages.json from node modules i see this: "version": "9.0.0-rc.5"

@CodyJasonBennett
Copy link
Member

This might need #3032.

@vinkovsky
Copy link
Author

vinkovsky commented Feb 7, 2025

maybe there is a way to attach the r3f event system to a scene loaded via useGLTF to fix this for now?

@vinkovsky
Copy link
Author

vinkovsky commented Feb 7, 2025

this definitely works with <mesh> tag, but the loaded scene may include other objects like lights, skinned mesh, bones, groups etc. If I try to parse the scene and load it with jsx, sometimes I get wrong positions/scaling/rotation even though I pass its properties as is. Could you please suggest me an elegant way to handle pointer events in this case?

@CodyJasonBennett
Copy link
Member

We'll be releasing another fix for this in a moment. Seems that you caught a few that we never merged fixed for.

@CodyJasonBennett
Copy link
Member

A fix is now released in 9.0.0-rc.7. Thanks again.

@vinkovsky
Copy link
Author

@CodyJasonBennett Hi again! 😅 Pointer event coordinates don't respect layout.

pointer-issue.zip

@vinkovsky
Copy link
Author

Image

@vinkovsky
Copy link
Author

Image

@vinkovsky
Copy link
Author

i use react-resizable-panels

@vinkovsky
Copy link
Author

Everything is ok now. Thank you

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants