Commit 3dd816c
Add workaround fix for facebook#35350 (facebook#38073)
Summary:
This PR is a result of this PR, which got merged but then reverted:
- facebook#37913
We are trying to implement a workaround for facebook#35350, so react-native users on android API 33+ can use `<FlatList inverted={true} />` without running into ANRs.
As explained in the issue, starting from android API 33 there are severe performance issues when using scaleY: -1 on a view, and its child view, which is what we are doing when inverting the ScrollView component (e.g. in FlatList).
This PR adds a workaround. The workaround is to also scale on the X-Axis which causes a different transform matrix to be created, that doesn't cause the ANR (see the issue for details).
However, when doing that the vertical scroll bar will be on the wrong side, thus we switch the position in the native code once we detect that the list is inverted, using the newly added `isInvertedVirtualizedList` prop.
This is a follow up PR to:
- facebook#38071
1 parent b1ceea4 commit 3dd816c
File tree
3 files changed
+7
-3
lines changed- packages/virtualized-lists/Lists
- __tests__/__snapshots__
3 files changed
+7
-3
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1080 | 1080 | | |
1081 | 1081 | | |
1082 | 1082 | | |
| 1083 | + | |
1083 | 1084 | | |
1084 | 1085 | | |
1085 | 1086 | | |
| |||
1974 | 1975 | | |
1975 | 1976 | | |
1976 | 1977 | | |
1977 | | - | |
1978 | | - | |
1979 | | - | |
| 1978 | + | |
| 1979 | + | |
| 1980 | + | |
| 1981 | + | |
1980 | 1982 | | |
1981 | 1983 | | |
1982 | 1984 | | |
| |||
Lines changed: 1 addition & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1014 | 1014 | | |
1015 | 1015 | | |
1016 | 1016 | | |
| 1017 | + | |
1017 | 1018 | | |
1018 | 1019 | | |
1019 | 1020 | | |
| |||
Lines changed: 1 addition & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
796 | 796 | | |
797 | 797 | | |
798 | 798 | | |
| 799 | + | |
799 | 800 | | |
800 | 801 | | |
801 | 802 | | |
| |||
0 commit comments