Open joonhocho opened 8 years ago
@joonhocho Did you ever find a solution to this issue? I'm having the same problem.
@danleveille I'm sorry, but no. I ended up using one sortable list per screen for the time being.
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.
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)
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?
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.
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.
SortableListView also doesn't appear to work when its nested inside any type of nested view.
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.