Skip to content

Commit

Permalink
fix inverted flat list
Browse files Browse the repository at this point in the history
  • Loading branch information
kosmydel committed Apr 19, 2024
1 parent 305f12c commit 172a326
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions patches/react-native+0.73.4+001+fix-inverted-flatlist.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
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
index a8ecce5..d42a518 100644
--- a/node_modules/react-native/ReactCommon/react/renderer/components/scrollview/ScrollViewShadowNode.cpp
+++ b/node_modules/react-native/ReactCommon/react/renderer/components/scrollview/ScrollViewShadowNode.cpp
@@ -66,6 +66,16 @@ void ScrollViewShadowNode::layout(LayoutContext layoutContext) {
Point ScrollViewShadowNode::getContentOriginOffset() const {
auto stateData = getStateData();
auto contentOffset = stateData.contentOffset;
+ auto props = getConcreteProps();
+
+ if (props.transform.operations.size() > 0) {
+ if (props.transform.operations[0].y == -1) {
+ return {-contentOffset.x, contentOffset.y - stateData.scrollAwayPaddingTop};
+ } else if (props.transform.operations[0].x == -1) {
+ return {contentOffset.x, -contentOffset.y + stateData.scrollAwayPaddingTop};
+ }
+ }
+
return {-contentOffset.x, -contentOffset.y + stateData.scrollAwayPaddingTop};
}

0 comments on commit 172a326

Please sign in to comment.