deanmcpherson / react-native-sortable-listview

Drag drop capable wrapper of ListView for React Native
MIT License
917 stars 235 forks source link

Endless scrolling ignores dragging #52

Closed lesniakania closed 7 years ago

lesniakania commented 7 years ago

Steps to reproduce:

  1. Set a list with elements so that not all of them fits the screen (you have a scroll in the scrollview)
  2. Start dragging an item
  3. Drag it to the bottom (or top) of the scroll view
  4. See that scroll is scrolling endlessly and any movement of the item is ignored.

See gif:

scrolling-issue

I tried to debug it, but all I noticed is that onPanResponderMove is not executed in this case, because component is constantly rerendering (probably because of the setState in the checkTargetElement) and scrollAnimation method is invoking all the time. setState -> render -> scrollAnimation -> setState -> render -> scrollAnimation -> ... and no onPanResponderMove

node: v5.9.0 npm: 3.10.8 react-native: 0.37 (but previously I had 0.31 and the same issues)

milesibastos commented 7 years ago

May you provide some code to reproduce this case?

lesniakania commented 7 years ago

You weren't responding for so long, so I'm no longer using your library actually. Does it work for you in the minimal setup (having any items, but many enough so they don't fit the screen as I described)?

lesniakania commented 7 years ago

@milesibastos ok, so I've checked this with the latest version now and the problem is reproducable if you just use your example code but wrap your component with ScrollView (even if it has scrolled disabled):

<ScrollView scrollEnabled={false} horizontal={true}>
      <SortableListView ....>
</ScrollView>
ajostergaard commented 7 years ago

@lesniakania Is this a duplicate of #38? By the way, did you find an alternative component that works for your scenario?

lesniakania commented 7 years ago

Yes, it's a duplicate, sorry. Unfortunately I didn't find any other component, so I implemented my own one...: https://github.com/lesniakania/react-native-draggable-board

chetstone commented 7 years ago

Closing duplicate #38