Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix inverted flat list #40547

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 23 additions & 0 deletions patches/react-native+0.73.4+014+fix-inverted-flatlist.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
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..6ad790e 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,7 +66,17 @@ void ScrollViewShadowNode::layout(LayoutContext layoutContext) {
Point ScrollViewShadowNode::getContentOriginOffset() const {
auto stateData = getStateData();
auto contentOffset = stateData.contentOffset;
- return {-contentOffset.x, -contentOffset.y + stateData.scrollAwayPaddingTop};
+ auto props = getConcreteProps();
+
+ float productX = 1.0f;
+ float productY = 1.0f;
+
+ for (const auto& operation : props.transform.operations) {
+ productX *= operation.x;
+ productY *= operation.y;
+ }
+
+ return {-contentOffset.x * productX, (-contentOffset.y + stateData.scrollAwayPaddingTop) * productY};
}

} // namespace facebook::react
Loading