Skip to content

MapControls and OrbitControls should have same hooks implementation #2495

@IlyaHalsky

Description

@IlyaHalsky
  • three version: 0.178.0
  • @react-three/fiber version: 9.2.0
  • @react-three/drei version: 10.5.1

Problem description:

If controls.dispose() is called while mouse is down, controls will not register mouse up and get stuck waiting for pointer to be removed here three-stdlib.controls.OrbitControls.onPointerDown

Relevant code:

In Sandbox, inside Controls component there are handleChange and badHandleChange
badHandleChage breaks MapControls, but doesn't affect OrbitControls

Suggested solution:

I'm not quite sure, here are my ideas:

  • drei.core.MapControls should have similar hook structure to drei.core.OrbitContorls.
  • controls.dispose() should be called with full recreation of underlying class from three-stdlib.controls, otherwise there is a risk to break internal state and get stuck

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions