NestableScrollContainer auto scrolls up when NestableDraggableFlatList is not the immediate child
Describe the bug
I have a NestableScrollContainer component wrapping multiple NestableDraggableFlatList components. If the NestableDraggableFlatList are not the first descendent (i.e. they are wrapped in a View) then when you press and hold on an item, the screen auto scrolls up.
To Reproduce Here is a demo.
I put everything in the ListOfDraggableItems.js
Platform & Dependencies Happens on both iOS and Android
Additional context Here is a demo. You can't really see my touches, but when I tap and hold an Item, I am NOT moving my finger. So the screen should not scroll. But it does.
https://github.com/user-attachments/assets/31e9ef2d-55d6-4038-9174-08a01f0b20a2
Same issue here, any updates on that?
Same issue here. Were you able to resolve it?
Same issue here. Were you able to resolve it?
~~I think I fixed it by utilizing onDragBegin and onDragEnd. Something like this~~
<NestableDraggableFlatList
data={data}
onDragBegin={index => {
setDisableParentScrollView(true);
}}
onDragEnd={({ data }) => {
setDisableParentScrollView(false);
}}
Actually, ignore that. I do use these but I just used multiple NestableScrollContainer comoponents. One for each NestableDraggableFlatList and I moved the other Text and View components to be parents. Like this
<View>
<Text>Something</Text>
<NestableScrollContainer>
<NestableDraggableFlatList>
...
</NestableDraggableFlatList>
</NestableScrollContainer>
</View>
@Code-yWilliams I updated my expo snack. Check out the WorkAroundListOfDraggableItems.js file. That works pretty well.
@jaaywags Solid workaround! I suppose the only downside is that if you're trying to move an item to a position that is currently off screen, the parent is unable to scroll it into view for us to place it there. Not a huge deal but depends on the use case I suppose. Thanks for sharing!