pmndrs / drei

🥉 useful helpers for react-three-fiber
https://drei.pmnd.rs/
MIT License
7.85k stars 641 forks source link

<Select> component breaks if canvas size changes during box select #1960

Open romankoho opened 1 month ago

romankoho commented 1 month ago

Problem description:

I have a layout with two columns. In the left column, I render the three-js scene and in the right column a HTML div that shrinks/expands its width depending on the state of a button.

When clicking a button, box-select of the component messes up. A selection box remains on the screen and the orbit controls do not work anymore. See this video of the behavior (the cursor was not recorded, I hope it still helps):

Select_bug.webm

Suggested solution:

I thought of adding an "enabled"-flag to the (in my case when the layout is ready)