react-native-draggable-flatlist icon indicating copy to clipboard operation
react-native-draggable-flatlist copied to clipboard

A way to prevent dragging above a certain index

Open msvickylau opened this issue 3 years ago • 4 comments

Is your feature request related to a problem? Please describe. I'm using stickyHeaderIndices for headers and need a way to prevent dragging an item above them. Would there be a way to set a constrain or set the bound to after a certain item's index number?

Describe the solution you'd like A way to prevent dragging above a certain index. Ex: startDragIndex={3}, with default 0. And it measures the total height items before startDragIndex and sets the container size?

Describe alternatives you've considered Attempted to nest items in a parent FlatList but that causes issues with auto-scrolling on DraggableFlatList

Additional context

msvickylau avatar May 18 '21 21:05 msvickylau

any update on this?

AishwaryaSurana avatar Aug 17 '21 05:08 AishwaryaSurana

Currently, I'm using to index inside onDragEnd to find out if an item is moving beyond a certain index.

 onDragEnd={({ data, from, to }) => {
               if(to!=headerIndex) {
                 //change state data only when **to** index matches the contraints
                }
    }}

ithebk avatar Sep 19 '21 10:09 ithebk

any update on this?

sergeymild avatar Sep 27 '21 12:09 sergeymild

This would be very useful to me :/

ftzi avatar Oct 07 '21 23:10 ftzi