[Mobile][Tech-debt] VirtualizedList inside the BottomSheet #23902
Labels
Mobile App - i.e. Android or iOS
Native mobile impl of the block editor. (Note: used in scripts, ping mobile folks to change)
[Type] Performance
Related to performance efforts
Our current BottomSheet wraps its content into the ScrollView component which causes a performance issue if we have VirtualizedList (FlatList) inside. We can not remove the ScrollView for all BottomSheet contents but we definitely can do that if there is FlatList or ScrollView inside. We need to wrap the content of BottomSheet into the ScrollView and use some of its props to control the swipe to close mechanism and because of that, we need to pass these props to the FlatList if we remove the scroll view. I made a fix for that here: #23873 where i pass these props by the BottomSheetContext and wrap the content into ScrollView depending of
isChildrenScrollable
prop. I feel like there could be a better way to handle that. I.e we could implement it similar to the KeyboardAvoidingView. We would haveBottomSheetScrollView
,BottomSheetFlatList
, and pass all props toBottomSheet
instead like here:gutenberg/packages/components/src/mobile/keyboard-aware-flat-list/index.ios.js
Line 23 in a1cf84a
I created this issue to hear your thoughts on how we could improve the BottomSheet to support VirtualizedLists inside.
cc: @pinarol @lukewalczak @mkevins @geriux
The text was updated successfully, but these errors were encountered: