Closed jacob-lcs closed 2 years ago
Fair enough, that could / should be fixed, thanks for reporting this. This bug should only occur with preventScroll
option set.
I'd need to run some tests to make sure we could safely remove those lines (the gesture cleaning might be done elsewhere).
Sorry for the long wait, should now be fixed!
Describe the bug
Clicking on the screen with another finger while dragging an element interrupts the dragging behavior, unless you remove the dragging finger and start dragging again
Sandbox or Video
codesandbox link: https://codesandbox.io/s/confident-beaver-556uec
https://user-images.githubusercontent.com/40483898/164155641-e7c6963d-fd89-4eaf-9659-4892b5ef0c91.MP4
I looked at the source code and found that these two lines of code were the problem.
https://github.com/pmndrs/use-gesture/blob/main/packages/core/src/engines/DragEngine.ts#L296-L297
The other finger clicked and set
_pointerActive
tofalse
, which broke the drag behavior. If these two lines of code were removed, they would behave normally, as follows:https://user-images.githubusercontent.com/40483898/164156275-9191767f-bf21-4f67-9ed4-60cd87289336.MP4
I didn't submit the PR because I wasn't sure what problem these two lines of code were solving
Information:
Checklist:
touch-action: none
to the draggable element.