In this sample app I have used react-use-gesture library to create drag and drop with the following features (mobile-only).
The sample code for drag and drop provided by react-use-spring is using animation library like react-spring. I have removed that dependency. So that in this sample you can react-use-gesture independent of react-spring giving you more flexibility.
The sample code provided by react-use-gesture for drag and drop does not support scrolling of the page when the user reaches the top or bottom edge of the page while dragging items while reordering. In this example code you can see how to support that feature.
I have added the feature for long press. So that the user can activate the reordering (Dragging) by longpressing an item for approx. 2 seconds.
I have added the feature where the user can swipe to right for revealing the delete item.
- swipe right to delete
- long press to activate drag and drop
- scroll page while dragging items beyond viewport