Skip to content

Commit 95ee618

Browse files
committed
feat(react): useDragAndDrop event handling enhanced
1 parent 6f885e7 commit 95ee618

7 files changed

Lines changed: 386 additions & 87 deletions

File tree

docs/docs/react/use-drag-and-drop.mdx

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,3 +52,19 @@ function App() {
5252
return <div ref={ref}>This block is draggable</div>;
5353
}
5454
```
55+
56+
### Touch events
57+
58+
By default hook prevents `touchstart` on target element and `touchmove` on window.
59+
This is needed to prevent parent element scrolling and "pull-to-refresh" on touch devices.
60+
61+
To disable or change this behavior you can pass `needPreventTouch` option:
62+
63+
```ts
64+
useDragAndDrop({
65+
// should return boolean
66+
needPreventTouch: element => false,
67+
68+
// ...other options
69+
});
70+
```

0 commit comments

Comments
 (0)