@@ -1203,6 +1203,12 @@ class VirtualizedList extends React.PureComponent<Props, State> {
1203
1203
1204
1204
_defaultRenderScrollComponent = props => {
1205
1205
const onRefresh = props . onRefresh ;
1206
+ const inversionStyle = this . props . inverted
1207
+ ? this . props . horizontal
1208
+ ? styles . rowReverse
1209
+ : styles . columnReverse
1210
+ : null ;
1211
+
1206
1212
if ( this . _isNestedWithSameOrientation ( ) ) {
1207
1213
// $FlowFixMe - Typing ReactNativeComponent revealed errors
1208
1214
return < View { ...props } /> ;
@@ -1231,11 +1237,23 @@ class VirtualizedList extends React.PureComponent<Props, State> {
1231
1237
props . refreshControl
1232
1238
)
1233
1239
}
1240
+ contentContainerStyle = { StyleSheet . compose (
1241
+ inversionStyle ,
1242
+ this . props . contentContainerStyle ,
1243
+ ) }
1234
1244
/>
1235
1245
) ;
1236
1246
} else {
1237
1247
// $FlowFixMe Invalid prop usage
1238
- return < ScrollView { ...props } /> ;
1248
+ return (
1249
+ < ScrollView
1250
+ { ...props }
1251
+ contentContainerStyle = { StyleSheet . compose (
1252
+ inversionStyle ,
1253
+ this . props . contentContainerStyle ,
1254
+ ) }
1255
+ />
1256
+ ) ;
1239
1257
}
1240
1258
} ;
1241
1259
@@ -1703,6 +1721,11 @@ class VirtualizedList extends React.PureComponent<Props, State> {
1703
1721
this . _getFrameMetricsApprox ,
1704
1722
this . _scrollMetrics ,
1705
1723
) ;
1724
+
1725
+ // revert the state if calculations are off
1726
+ if ( newState . first === newState . last ) {
1727
+ newState = state
1728
+ }
1706
1729
}
1707
1730
}
1708
1731
} else {
@@ -2061,10 +2084,10 @@ function describeNestedLists(childList: {
2061
2084
2062
2085
const styles = StyleSheet . create ( {
2063
2086
verticallyInverted : {
2064
- flexDirection : 'column-reverse' ,
2087
+ transform : [ { scaleY : - 1 } ] ,
2065
2088
} ,
2066
2089
horizontallyInverted : {
2067
- flexDirection : 'row-reverse' ,
2090
+ transform : [ { scaleX : - 1 } ] ,
2068
2091
} ,
2069
2092
row : {
2070
2093
flexDirection : 'row' ,
0 commit comments