pietile-native-kit icon indicating copy to clipboard operation
pietile-native-kit copied to clipboard

FlattList inside keyboard-aware-scrollview

Open amin79 opened this issue 2 years ago • 5 comments

I have a dropdown inside the keyboard-aware-scrollview which uses FlatList to render the items. But I get error "VirtualizedLists should never be nested inside plain ScrollViews..."

How should I solve this problem?

amin79 avatar Feb 23 '23 09:02 amin79

Hi! Did you try this solution from readme?

mxck avatar Feb 23 '23 10:02 mxck

Thank you for your answer. Yes. As I understand it return a FlatList. But how it can bee inside a KeyboardAwareScrollView? I don't get it.

amin79 avatar Feb 23 '23 11:02 amin79

Oh sorry, I got it. There's probably no solution in your case :\

Perhaps only if you show Dropdown in Modal?

mxck avatar Feb 23 '23 11:02 mxck

It’s sad that such a good library can’t do that. Showing that in modal could be the solution. But it’s not nice on web. I think I should use modal on mobile and dropdown on web. Because I don’t get any error on web. Thanks

amin79 avatar Feb 23 '23 12:02 amin79

Try to use a FlatList instead of the ScrollView. Perhaps try the FlatList Example of this repo or search for another FlatListAwareKeyboard solution. Place all the content in the ListHeaderComponent. A virtualized list in a virtualized list is no problem and should do the trick.

borstelmannl avatar Mar 07 '23 15:03 borstelmannl