react-native-sortable-listview icon indicating copy to clipboard operation
react-native-sortable-listview copied to clipboard

Not working when it is nested inside a ScrollView?

Open joonhocho opened this issue 9 years ago • 8 comments

I am currently testing out this lib. Great work by the way, but it doesn't seem to work when nested inside a ScrollView. It works fine without parent ScrollView though. My use case is that there are multiple sortable lists in one screen divided into different sections.

joonhocho avatar Sep 07 '16 06:09 joonhocho

@joonhocho Did you ever find a solution to this issue? I'm having the same problem.

danleveille avatar Oct 05 '16 08:10 danleveille

@danleveille I'm sorry, but no. I ended up using one sortable list per screen for the time being.

joonhocho avatar Oct 05 '16 11:10 joonhocho

Hey @joonhocho, sorry for the VERY late reply. This probably won't work. You could potentially track when the drag begins / stops and set scrollEnabled={false} on the parent ScrollView? However, the parent scroll view won't automatically scroll if this does work.

deanmcpherson avatar Oct 30 '16 22:10 deanmcpherson

A couple tricks I used to get around this issue for different use cases are: 1- Using a ListView header renderHeader={() => this.props.header} 2- Pressing an Edit button would change the original view into this component and hide everything else (including the original scrollview)

TheSisb avatar Nov 02 '16 23:11 TheSisb

Thanks @TheSisb. This kind of functionality would need some serious changes to the code, and a lot of thought. Would adding section support to the scrollview achieve this? And preventing drag / drop between sections?

deanmcpherson avatar Nov 07 '16 21:11 deanmcpherson

For case 1 (header), I do it in my fork here: https://github.com/hammerandchisel/react-native-sortable-listview/blob/master/index.js

For case 2 - I don't think it's the responsibility of this lib to handle. The user's app should handle it.

It would be cool if this lib prevented drag/drop between sections 👍 . Right now on edit, I simply hide everything except the editable (drag/drop) items.

TheSisb avatar Nov 07 '16 23:11 TheSisb

I think I am just going to make it so that there are two sections, each with a header and their own sortable-listview but only one section can be open at a time. Not a perfect solution but that way there is only ever one scrollable area at a time, and each has a header. Opening one will cause the other to close, etc.

smilingkylan avatar Apr 25 '17 20:04 smilingkylan

SortableListView also doesn't appear to work when its nested inside any type of nested view.

adriennealyzee avatar Sep 07 '17 16:09 adriennealyzee