Skip to content

NestableScrollContainer auto scrolls up when NestableDraggableFlatList is not the immediate child #587

Open

Description

@jaaywags

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.

ScreenRecording_04-24-2025.21-25-46_1.mp4

Activity

  1. maciejewiczow commented on Aug 24, 2025

    @maciejewiczow

    Same issue here, any updates on that?

  2. Code-yWilliams commented on Sep 30, 2025

    @Code-yWilliams

    Same issue here. Were you able to resolve it?

  3. jaaywags commented on Sep 30, 2025

    @jaaywags
    Author

    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>
  4. jaaywags commented on Sep 30, 2025

    @jaaywags
    Author

    @Code-yWilliams I updated my expo snack. Check out the WorkAroundListOfDraggableItems.js file. That works pretty well.

  5. Code-yWilliams commented on Sep 30, 2025

    @Code-yWilliams

    @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!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions