Skip to content

Commit ebd5a65

Browse files
committed
fix patch 007: preserve MVCP spread when removing shouldMaintainVisibleContentPosition
1 parent 159c902 commit ebd5a65

1 file changed

Lines changed: 7 additions & 9 deletions

File tree

patches/@shopify/flash-list/@shopify+flash-list+2.3.0+007+fix-scroll-anchor-unmount-on-ios.patch

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
11
diff --git a/node_modules/@shopify/flash-list/dist/recyclerview/RecyclerView.js b/node_modules/@shopify/flash-list/dist/recyclerview/RecyclerView.js
2-
index ee42f63..4e8d8c0 100644
32
--- a/node_modules/@shopify/flash-list/dist/recyclerview/RecyclerView.js
43
+++ b/node_modules/@shopify/flash-list/dist/recyclerview/RecyclerView.js
5-
@@ -380,16 +380,14 @@ const RecyclerViewComponent = (props, ref) => {
4+
@@ -308,16 +308,15 @@
65
}
76
return onScrollHandler;
87
}, [onScrollHandler, scrollY, stickyHeaders, stickyHeaderUseNativeDriver]);
@@ -11,7 +10,7 @@ index ee42f63..4e8d8c0 100644
1110
- if (shouldMaintainVisibleContentPosition) {
1211
+ if (maintainVisibleContentPosition != null) {
1312
return {
14-
- ...maintainVisibleContentPosition,
13+
...maintainVisibleContentPosition,
1514
minIndexForVisible: 0,
1615
};
1716
}
@@ -21,7 +20,7 @@ index ee42f63..4e8d8c0 100644
2120
const shouldRenderFromBottom = recyclerViewManager.getDataLength() > 0 &&
2221
((_d = maintainVisibleContentPosition === null || maintainVisibleContentPosition === void 0 ? void 0 : maintainVisibleContentPosition.startRenderingFromBottom) !== null && _d !== void 0 ? _d : false);
2322
// Create view for measuring bounded size
24-
@@ -401,11 +399,11 @@ const RecyclerViewComponent = (props, ref) => {
23+
@@ -329,11 +328,11 @@
2524
}, ref: firstChildViewRef }));
2625
}, [horizontal, stickyHeaderOffset]);
2726
const scrollAnchor = useMemo(() => {
@@ -36,10 +35,9 @@ index ee42f63..4e8d8c0 100644
3635
// Render the main RecyclerView structure
3736
return (React.createElement(RecyclerViewContextProvider, { value: recyclerViewContext },
3837
diff --git a/node_modules/@shopify/flash-list/src/recyclerview/RecyclerView.tsx b/node_modules/@shopify/flash-list/src/recyclerview/RecyclerView.tsx
39-
index b2bd67a..d4bf02d 100644
4038
--- a/node_modules/@shopify/flash-list/src/recyclerview/RecyclerView.tsx
4139
+++ b/node_modules/@shopify/flash-list/src/recyclerview/RecyclerView.tsx
42-
@@ -572,18 +572,14 @@ const RecyclerViewComponent = <T,>(
40+
@@ -480,18 +480,15 @@
4341
return onScrollHandler;
4442
}, [onScrollHandler, scrollY, stickyHeaders, stickyHeaderUseNativeDriver]);
4543

@@ -50,7 +48,7 @@ index b2bd67a..d4bf02d 100644
5048
- if (shouldMaintainVisibleContentPosition) {
5149
+ if (maintainVisibleContentPosition != null) {
5250
return {
53-
- ...maintainVisibleContentPosition,
51+
...maintainVisibleContentPosition,
5452
minIndexForVisible: 0,
5553
};
5654
}
@@ -60,7 +58,7 @@ index b2bd67a..d4bf02d 100644
6058

6159
const shouldRenderFromBottom =
6260
recyclerViewManager.getDataLength() > 0 &&
63-
@@ -604,7 +600,7 @@ const RecyclerViewComponent = <T,>(
61+
@@ -512,7 +509,7 @@
6462
}, [horizontal, stickyHeaderOffset]);
6563

6664
const scrollAnchor = useMemo(() => {
@@ -69,7 +67,7 @@ index b2bd67a..d4bf02d 100644
6967
return (
7068
<ScrollAnchor
7169
horizontal={Boolean(horizontal)}
72-
@@ -613,7 +609,7 @@ const RecyclerViewComponent = <T,>(
70+
@@ -521,7 +518,7 @@
7371
);
7472
}
7573
return null;

0 commit comments

Comments
 (0)