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)
Sat, Nov 9, 11:38 PM
Unknown Object (File)
Fri, Nov 8, 3:08 AM
Unknown Object (File)
Mon, Nov 4, 3:10 AM
Unknown Object (File)
Mon, Nov 4, 3:10 AM
Unknown Object (File)
Mon, Nov 4, 3:10 AM
Unknown Object (File)
Mon, Nov 4, 3:00 AM
Unknown Object (File)
Sun, Oct 27, 6:19 PM
Unknown Object (File)
Sun, Oct 27, 6:19 PM
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