Skip to content

Commit 172a326

Browse files
committed
fix inverted flat list
1 parent 305f12c commit 172a326

1 file changed

Lines changed: 21 additions & 0 deletions

File tree

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
diff --git a/node_modules/react-native/ReactCommon/react/renderer/components/scrollview/ScrollViewShadowNode.cpp b/node_modules/react-native/ReactCommon/react/renderer/components/scrollview/ScrollViewShadowNode.cpp
2+
index a8ecce5..d42a518 100644
3+
--- a/node_modules/react-native/ReactCommon/react/renderer/components/scrollview/ScrollViewShadowNode.cpp
4+
+++ b/node_modules/react-native/ReactCommon/react/renderer/components/scrollview/ScrollViewShadowNode.cpp
5+
@@ -66,6 +66,16 @@ void ScrollViewShadowNode::layout(LayoutContext layoutContext) {
6+
Point ScrollViewShadowNode::getContentOriginOffset() const {
7+
auto stateData = getStateData();
8+
auto contentOffset = stateData.contentOffset;
9+
+ auto props = getConcreteProps();
10+
+
11+
+ if (props.transform.operations.size() > 0) {
12+
+ if (props.transform.operations[0].y == -1) {
13+
+ return {-contentOffset.x, contentOffset.y - stateData.scrollAwayPaddingTop};
14+
+ } else if (props.transform.operations[0].x == -1) {
15+
+ return {contentOffset.x, -contentOffset.y + stateData.scrollAwayPaddingTop};
16+
+ }
17+
+ }
18+
+
19+
return {-contentOffset.x, -contentOffset.y + stateData.scrollAwayPaddingTop};
20+
}
21+

0 commit comments

Comments
 (0)