We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 338a7c7 + edb2d59 commit 404d0cbCopy full SHA for 404d0cb
src/utils/useDrag.ts
@@ -46,7 +46,9 @@ export const useDrag = ({
46
47
const clientRect = useMemo(
48
() => gl.domElement.getBoundingClientRect(),
49
- [gl.domElement]
+ // Size dependency ensures the clientRect updates when container dimensions change.
50
+ // Without it, drag calculations would use stale positioning data from the previous container size.
51
+ [gl.domElement, size]
52
);
53
54
return useGesture(
0 commit comments