Page MenuHomePhabricator

[native] Fix scrolling in screen inside StackNavigator on Android
ClosedPublic

Authored by ashoat on Jan 27 2023, 8:42 AM.
Tags
None
Referenced Files
Unknown Object (File)
Apr 5 2024, 12:45 AM
Unknown Object (File)
Apr 5 2024, 12:45 AM
Unknown Object (File)
Apr 5 2024, 12:45 AM
Unknown Object (File)
Apr 5 2024, 12:41 AM
Unknown Object (File)
Mar 12 2024, 11:37 PM
Unknown Object (File)
Feb 26 2024, 8:31 PM
Unknown Object (File)
Feb 20 2024, 10:59 AM
Unknown Object (File)
Feb 20 2024, 7:07 AM
Subscribers

Details

Summary

This fixes ENG-2845, which I introduced in D6331.

It looks like gestureEnabled breaks scrolling on Android. I found a ton of GitHub issues discussing this, and the solution in all of them was to use FlatList from react-native-gesture-handler.

In this diff I went through every FlatList or ScrollView used in a StackNavigator where we have introduced gestureEnabled in D6331 (Chat and Profile), and I switched them to use FlatList from react-native-gesture-handler.

Test Plan
  1. First, I ran git grep ScrollView and git grep FlatList in native/chat and native/profile to try to find any examples of cases that needed to be changed
  2. I deployed the app to a physical Android device to verify that scrolling still worked for all of the interfaces I fixed up

Diff Detail

Repository
rCOMM Comm
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

native/chat/chat-list.react.js
218 ↗(On Diff #21466)

It's okay to use any here because we immediately cast the result to a valid type. The use of any is necessary to use react-native-gesture-handler's FlatList (which doesn't have Flow types), but to type it using the Flow types for the default react-native FlatList

This revision is now accepted and ready to land.Jan 30 2023, 4:17 AM