|
| 1 | +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 |
| 3 | +--- a/node_modules/@shopify/flash-list/dist/recyclerview/RecyclerView.js |
| 4 | ++++ b/node_modules/@shopify/flash-list/dist/recyclerview/RecyclerView.js |
| 5 | +@@ -380,16 +380,15 @@ const RecyclerViewComponent = (props, ref) => { |
| 6 | + } |
| 7 | + return onScrollHandler; |
| 8 | + }, [onScrollHandler, scrollY, stickyHeaders, stickyHeaderUseNativeDriver]); |
| 9 | +- const shouldMaintainVisibleContentPosition = recyclerViewManager.shouldMaintainVisibleContentPosition(); |
| 10 | + const maintainVisibleContentPositionInternal = useMemo(() => { |
| 11 | +- if (shouldMaintainVisibleContentPosition) { |
| 12 | ++ if (maintainVisibleContentPosition != null) { |
| 13 | + return { |
| 14 | + ...maintainVisibleContentPosition, |
| 15 | + minIndexForVisible: 0, |
| 16 | + }; |
| 17 | + } |
| 18 | + return undefined; |
| 19 | +- }, [maintainVisibleContentPosition, shouldMaintainVisibleContentPosition]); |
| 20 | ++ }, [maintainVisibleContentPosition]); |
| 21 | + const shouldRenderFromBottom = recyclerViewManager.getDataLength() > 0 && |
| 22 | + ((_d = maintainVisibleContentPosition === null || maintainVisibleContentPosition === void 0 ? void 0 : maintainVisibleContentPosition.startRenderingFromBottom) !== null && _d !== void 0 ? _d : false); |
| 23 | + // Create view for measuring bounded size |
| 24 | +@@ -401,11 +399,11 @@ const RecyclerViewComponent = (props, ref) => { |
| 25 | + }, ref: firstChildViewRef })); |
| 26 | + }, [horizontal, stickyHeaderOffset]); |
| 27 | + const scrollAnchor = useMemo(() => { |
| 28 | +- if (shouldMaintainVisibleContentPosition) { |
| 29 | ++ if (maintainVisibleContentPosition != null) { |
| 30 | + return (React.createElement(ScrollAnchor, { horizontal: Boolean(horizontal), scrollAnchorRef: scrollAnchorRef })); |
| 31 | + } |
| 32 | + return null; |
| 33 | +- }, [horizontal, shouldMaintainVisibleContentPosition]); |
| 34 | ++ }, [horizontal, maintainVisibleContentPosition]); |
| 35 | + // console.log("render", recyclerViewManager.getRenderStack()); |
| 36 | + // Render the main RecyclerView structure |
| 37 | + return (React.createElement(RecyclerViewContextProvider, { value: recyclerViewContext }, |
| 38 | +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 |
| 40 | +--- a/node_modules/@shopify/flash-list/src/recyclerview/RecyclerView.tsx |
| 41 | ++++ b/node_modules/@shopify/flash-list/src/recyclerview/RecyclerView.tsx |
| 42 | +@@ -572,18 +572,15 @@ const RecyclerViewComponent = <T,>( |
| 43 | + return onScrollHandler; |
| 44 | + }, [onScrollHandler, scrollY, stickyHeaders, stickyHeaderUseNativeDriver]); |
| 45 | + |
| 46 | +- const shouldMaintainVisibleContentPosition = |
| 47 | +- recyclerViewManager.shouldMaintainVisibleContentPosition(); |
| 48 | +- |
| 49 | + const maintainVisibleContentPositionInternal = useMemo(() => { |
| 50 | +- if (shouldMaintainVisibleContentPosition) { |
| 51 | ++ if (maintainVisibleContentPosition != null) { |
| 52 | + return { |
| 53 | + ...maintainVisibleContentPosition, |
| 54 | + minIndexForVisible: 0, |
| 55 | + }; |
| 56 | + } |
| 57 | + return undefined; |
| 58 | +- }, [maintainVisibleContentPosition, shouldMaintainVisibleContentPosition]); |
| 59 | ++ }, [maintainVisibleContentPosition]); |
| 60 | + |
| 61 | + const shouldRenderFromBottom = |
| 62 | + recyclerViewManager.getDataLength() > 0 && |
| 63 | +@@ -604,7 +600,7 @@ const RecyclerViewComponent = <T,>( |
| 64 | + }, [horizontal, stickyHeaderOffset]); |
| 65 | + |
| 66 | + const scrollAnchor = useMemo(() => { |
| 67 | +- if (shouldMaintainVisibleContentPosition) { |
| 68 | ++ if (maintainVisibleContentPosition != null) { |
| 69 | + return ( |
| 70 | + <ScrollAnchor |
| 71 | + horizontal={Boolean(horizontal)} |
| 72 | +@@ -613,7 +609,7 @@ const RecyclerViewComponent = <T,>( |
| 73 | + ); |
| 74 | + } |
| 75 | + return null; |
| 76 | +- }, [horizontal, shouldMaintainVisibleContentPosition]); |
| 77 | ++ }, [horizontal, maintainVisibleContentPosition]); |
| 78 | + |
| 79 | + // console.log("render", recyclerViewManager.getRenderStack()); |
| 80 | + |
0 commit comments