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
F3485707: D6417.diff
Wed, Dec 18, 12:38 AM
Unknown Object (File)
Nov 9 2024, 11:38 PM
Unknown Object (File)
Nov 8 2024, 3:08 AM
Unknown Object (File)
Nov 4 2024, 3:10 AM
Unknown Object (File)
Nov 4 2024, 3:10 AM
Unknown Object (File)
Nov 4 2024, 3:10 AM
Unknown Object (File)
Nov 4 2024, 3:00 AM
Unknown Object (File)
Oct 27 2024, 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
Branch
master
Lint
No Lint Coverage
Unit
No Test Coverage

Event Timeline

native/chat/chat-list.react.js
218

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