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

DragControls Not Functioning Correctly #1995

Closed
AshhadDevLab opened this issue Jun 15, 2024 · 0 comments
Closed

DragControls Not Functioning Correctly #1995

AshhadDevLab opened this issue Jun 15, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@AshhadDevLab
Copy link

  • three: 0.164.1
  • @react-three/fiber: 8.16.6
  • @react-three/drei: 9.105.6
  • node: 21.5.0
  • npm: 10.2.4

Problem description:

I am facing two issues with the DragControls component from @react-three/drei.

  1. Console Output Discrepancy:
    When I attach a ref to the DragControls or console.log the DragControls, the output is not as expected. Here is the output I receive:
Screenshot 2024-06-15 at 1 54 49 PM

In contrast, performing the same action with DragControls in vanilla three.js yields the expected methods and properties:

Screenshot 2024-06-15 at 2 09 17 PM
  1. Non-modifiable Recursive Property and Incorrect Drag Behavior:
    The recursive property of DragControls in the @react-three/fiber implementation cannot be modified. Additionally, when attempting to drag an object that is behind another object, the control behaves incorrectly by dragging all objects behind it, rather than the front-most object. This behavior mimics a raycaster .intersectObjects instead of the expected drag behavior. Also I dont understand the snapping of the objects kinda back to their original position.
Screen.Recording.2024-06-15.at.2.17.03.PM.mov

I am unsure if these are bugs or if I am missing some implementation details, but any help regarding these issues would be appreciated.

Relevant code:

CodeSandbox

Suggested solution:

I think there should be an individual prop for recursive and other properties inside of the React component. Additionally, when the ref is consoled, it should output the properties, the current state, and include the prototype and constructors of the DragControls.

@AshhadDevLab AshhadDevLab added the bug Something isn't working label Jun 15, 2024
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

No branches or pull requests

2 participants