Skip to content
Merged
Show file tree
Hide file tree
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
72 changes: 48 additions & 24 deletions patches/@legendapp__list@3.3.5.patch
Original file line number Diff line number Diff line change
Expand Up @@ -241,7 +241,7 @@ index ce1fe00001c9e5aee6c6ea8bb2d4757d4586d002..3ccf6f16067152dfcb0c143371e2ec6a
* Number of columns to render items in.
* @default 1
diff --git a/react-native.js b/react-native.js
index b3c5a306b293f797a8b338adfca3060c0f6db22b..24d0763aef074411eb7d17f0feb8df752a843de0 100644
index b3c5a306b293f797a8b338adfca3060c0f6db22b..ddca4bcd8a5dc5863cb65e03b6cfac0047a8ead3 100644
--- a/react-native.js
+++ b/react-native.js
@@ -717,6 +717,15 @@ function hasActiveInitialScroll(state) {
Expand Down Expand Up @@ -674,7 +674,19 @@ index b3c5a306b293f797a8b338adfca3060c0f6db22b..24d0763aef074411eb7d17f0feb8df75
contentContainerStyle: [
horizontal ? { height: "100%" } : {},
contentContainerStyle,
@@ -6751,7 +6950,7 @@ function createImperativeHandle(ctx, scheduleImperativeScrollCommit) {
@@ -6010,7 +6209,10 @@ var ListComponent = typedMemo(function ListComponent2({
],
contentOffset: initialContentOffset !== void 0 ? horizontal ? { x: initialContentOffset, y: 0 } : { x: 0, y: initialContentOffset } : void 0,
horizontal,
- maintainVisibleContentPosition: maintainVisibleContentPosition.size || maintainVisibleContentPosition.data ? { minIndexForVisible: 0 } : void 0,
+ // Keep iOS anchored to ScrollAdjust even when JS position restoration is
+ // disabled. Re-enabling native MVCP mid-drag can compare its stale anchor
+ // with the 1e7 sentinel and scroll the entire list out of view.
+ maintainVisibleContentPosition: Platform.OS === "ios" || maintainVisibleContentPosition.size || maintainVisibleContentPosition.data ? { minIndexForVisible: 0 } : void 0,
onLayout,
onScroll: onScroll2,
ref: refScrollView,
@@ -6751,7 +6953,7 @@ function createImperativeHandle(ctx, scheduleImperativeScrollCommit) {
endBuffered: state.endBuffered,
getAverageItemSizes: () => getAverageItemSizes(state),
indexByKey: (key) => state.indexByKey.get(key),
Expand All @@ -683,15 +695,15 @@ index b3c5a306b293f797a8b338adfca3060c0f6db22b..24d0763aef074411eb7d17f0feb8df75
isAtStart: peek$(ctx, "isAtStart"),
isEndReached: state.isEndReached,
isNearEnd: peek$(ctx, "isNearEnd"),
@@ -7075,6 +7274,7 @@ var LegendListInner = typedForwardRef(function LegendListInner2(props, forwarded
@@ -7075,6 +7277,7 @@ var LegendListInner = typedForwardRef(function LegendListInner2(props, forwarded
dataVersion,
drawDistance = 250,
contentInsetEndAdjustment,
+ contentInsetStartAdjustment,
estimatedItemSize = 100,
estimatedListSize,
extraData,
@@ -7132,10 +7332,12 @@ var LegendListInner = typedForwardRef(function LegendListInner2(props, forwarded
@@ -7132,10 +7335,12 @@ var LegendListInner = typedForwardRef(function LegendListInner2(props, forwarded
const animatedPropsInternal = props.animatedPropsInternal;
const anchoredEndSpaceOwner = (_a3 = props.anchoredEndSpaceOwnerInternal) != null ? _a3 : "list";
const positionComponentInternal = props.positionComponentInternal;
Expand All @@ -704,7 +716,7 @@ index b3c5a306b293f797a8b338adfca3060c0f6db22b..24d0763aef074411eb7d17f0feb8df75
stickyPositionComponentInternal: _stickyPositionComponentInternal,
...restProps
} = rest;
@@ -7200,7 +7402,7 @@ var LegendListInner = typedForwardRef(function LegendListInner2(props, forwarded
@@ -7200,7 +7405,7 @@ var LegendListInner = typedForwardRef(function LegendListInner2(props, forwarded
const combinedRef = useCombinedRef(refScroller, refScrollView);
const keyExtractor = keyExtractorProp != null ? keyExtractorProp : ((_item, index) => index.toString());
const stickyHeaderIndices = stickyHeaderIndicesProp;
Expand All @@ -713,23 +725,23 @@ index b3c5a306b293f797a8b338adfca3060c0f6db22b..24d0763aef074411eb7d17f0feb8df75
const previousContentInsetEndAdjustmentRef = React2.useRef(contentInsetEndAdjustmentResolved);
const alwaysRenderIndices = React2.useMemo(() => {
const indices = getAlwaysRenderIndices(alwaysRender, dataProp, keyExtractor, anchoredEndSpace == null ? void 0 : anchoredEndSpace.anchorIndex);
@@ -7341,6 +7543,7 @@ var LegendListInner = typedForwardRef(function LegendListInner2(props, forwarded
@@ -7341,6 +7546,7 @@ var LegendListInner = typedForwardRef(function LegendListInner2(props, forwarded
contentContainerAlignItems: contentContainerStyle.alignItems,
contentInset,
contentInsetEndAdjustment: contentInsetEndAdjustmentResolved,
+ contentInsetStartAdjustment,
data: dataProp,
dataKey,
dataVersion,
@@ -7372,6 +7575,7 @@ var LegendListInner = typedForwardRef(function LegendListInner2(props, forwarded
@@ -7372,6 +7578,7 @@ var LegendListInner = typedForwardRef(function LegendListInner2(props, forwarded
renderItem,
rtl,
snapToIndices,
+ sizeComponentInternal,
stickyHeaderIndicesArr: stickyHeaderIndices != null ? stickyHeaderIndices : [],
stickyHeaderIndicesSet: React2.useMemo(() => new Set(stickyHeaderIndices != null ? stickyHeaderIndices : []), [stickyHeaderIndices == null ? void 0 : stickyHeaderIndices.join(",")]),
stickyPositionComponentInternal,
@@ -7423,6 +7627,13 @@ var LegendListInner = typedForwardRef(function LegendListInner2(props, forwarded
@@ -7423,6 +7630,13 @@ var LegendListInner = typedForwardRef(function LegendListInner2(props, forwarded
return void 0;
}
const resolvedOffset = (_a4 = initialScroll.contentOffset) != null ? _a4 : resolveInitialScrollOffset(ctx, initialScroll);
Expand All @@ -743,23 +755,23 @@ index b3c5a306b293f797a8b338adfca3060c0f6db22b..24d0763aef074411eb7d17f0feb8df75
return usesBootstrapInitialScroll && ((_b2 = state.initialScrollSession) == null ? void 0 : _b2.kind) === "bootstrap" && Platform.OS === "web" ? void 0 : resolvedOffset;
}, [usesBootstrapInitialScroll]);
React2.useLayoutEffect(() => {
@@ -7547,6 +7758,7 @@ var LegendListInner = typedForwardRef(function LegendListInner2(props, forwarded
@@ -7547,6 +7761,7 @@ var LegendListInner = typedForwardRef(function LegendListInner2(props, forwarded
[
dataKey,
dataVersion,
+ contentInsetStartAdjustment,
memoizedLastItemKeys.join(","),
numColumnsProp,
nextScrollAxisGap,
@@ -7643,6 +7855,7 @@ var LegendListInner = typedForwardRef(function LegendListInner2(props, forwarded
@@ -7643,6 +7858,7 @@ var LegendListInner = typedForwardRef(function LegendListInner2(props, forwarded
() => ({
getRenderedItem: (key) => getRenderedItem(ctx, key),
onMomentumScrollEnd: (event) => {
+ state.isMomentumScrolling = false;
checkFinishedScrollFallback(ctx);
if (state.props.onMomentumScrollEnd) {
state.props.onMomentumScrollEnd(event);
@@ -7651,6 +7864,8 @@ var LegendListInner = typedForwardRef(function LegendListInner2(props, forwarded
@@ -7651,6 +7867,8 @@ var LegendListInner = typedForwardRef(function LegendListInner2(props, forwarded
onScroll: (event) => onScroll(ctx, event),
onScrollBeginDrag: (event) => {
var _a4, _b2;
Expand All @@ -768,7 +780,7 @@ index b3c5a306b293f797a8b338adfca3060c0f6db22b..24d0763aef074411eb7d17f0feb8df75
prepareReachedEdgeForNextUserScroll(ctx);
(_b2 = (_a4 = state.props).onScrollBeginDrag) == null ? void 0 : _b2.call(_a4, event);
},
@@ -7676,11 +7891,18 @@ var LegendListInner = typedForwardRef(function LegendListInner2(props, forwarded
@@ -7676,11 +7894,18 @@ var LegendListInner = typedForwardRef(function LegendListInner2(props, forwarded
ListFooterComponent,
ListFooterComponentStyle,
ListHeaderComponent,
Expand All @@ -788,7 +800,7 @@ index b3c5a306b293f797a8b338adfca3060c0f6db22b..24d0763aef074411eb7d17f0feb8df75
recycleItems,
refreshControl: refreshControlElement ? stylePaddingTopState > 0 ? React2__namespace.cloneElement(refreshControlElement, {
diff --git a/react-native.mjs b/react-native.mjs
index 40e87cda8c9bc79a889e5542f29af429a24b24d4..90e0d1a9dfd07d0212aae308f547b9ff7e3ad022 100644
index 40e87cda8c9bc79a889e5542f29af429a24b24d4..b8c6faf0be51cbda3e8af01f290dbe97440bc623 100644
--- a/react-native.mjs
+++ b/react-native.mjs
@@ -696,6 +696,15 @@ function hasActiveInitialScroll(state) {
Expand Down Expand Up @@ -1221,7 +1233,19 @@ index 40e87cda8c9bc79a889e5542f29af429a24b24d4..90e0d1a9dfd07d0212aae308f547b9ff
contentContainerStyle: [
horizontal ? { height: "100%" } : {},
contentContainerStyle,
@@ -6730,7 +6929,7 @@ function createImperativeHandle(ctx, scheduleImperativeScrollCommit) {
@@ -5989,7 +6188,10 @@ var ListComponent = typedMemo(function ListComponent2({
],
contentOffset: initialContentOffset !== void 0 ? horizontal ? { x: initialContentOffset, y: 0 } : { x: 0, y: initialContentOffset } : void 0,
horizontal,
- maintainVisibleContentPosition: maintainVisibleContentPosition.size || maintainVisibleContentPosition.data ? { minIndexForVisible: 0 } : void 0,
+ // Keep iOS anchored to ScrollAdjust even when JS position restoration is
+ // disabled. Re-enabling native MVCP mid-drag can compare its stale anchor
+ // with the 1e7 sentinel and scroll the entire list out of view.
+ maintainVisibleContentPosition: Platform.OS === "ios" || maintainVisibleContentPosition.size || maintainVisibleContentPosition.data ? { minIndexForVisible: 0 } : void 0,
Comment thread
macroscopeapp[bot] marked this conversation as resolved.
onLayout,
onScroll: onScroll2,
ref: refScrollView,
@@ -6730,7 +6932,7 @@ function createImperativeHandle(ctx, scheduleImperativeScrollCommit) {
endBuffered: state.endBuffered,
getAverageItemSizes: () => getAverageItemSizes(state),
indexByKey: (key) => state.indexByKey.get(key),
Expand All @@ -1230,15 +1254,15 @@ index 40e87cda8c9bc79a889e5542f29af429a24b24d4..90e0d1a9dfd07d0212aae308f547b9ff
isAtStart: peek$(ctx, "isAtStart"),
isEndReached: state.isEndReached,
isNearEnd: peek$(ctx, "isNearEnd"),
@@ -7054,6 +7253,7 @@ var LegendListInner = typedForwardRef(function LegendListInner2(props, forwarded
@@ -7054,6 +7256,7 @@ var LegendListInner = typedForwardRef(function LegendListInner2(props, forwarded
dataVersion,
drawDistance = 250,
contentInsetEndAdjustment,
+ contentInsetStartAdjustment,
estimatedItemSize = 100,
estimatedListSize,
extraData,
@@ -7111,10 +7311,12 @@ var LegendListInner = typedForwardRef(function LegendListInner2(props, forwarded
@@ -7111,10 +7314,12 @@ var LegendListInner = typedForwardRef(function LegendListInner2(props, forwarded
const animatedPropsInternal = props.animatedPropsInternal;
const anchoredEndSpaceOwner = (_a3 = props.anchoredEndSpaceOwnerInternal) != null ? _a3 : "list";
const positionComponentInternal = props.positionComponentInternal;
Expand All @@ -1251,7 +1275,7 @@ index 40e87cda8c9bc79a889e5542f29af429a24b24d4..90e0d1a9dfd07d0212aae308f547b9ff
stickyPositionComponentInternal: _stickyPositionComponentInternal,
...restProps
} = rest;
@@ -7179,7 +7381,7 @@ var LegendListInner = typedForwardRef(function LegendListInner2(props, forwarded
@@ -7179,7 +7384,7 @@ var LegendListInner = typedForwardRef(function LegendListInner2(props, forwarded
const combinedRef = useCombinedRef(refScroller, refScrollView);
const keyExtractor = keyExtractorProp != null ? keyExtractorProp : ((_item, index) => index.toString());
const stickyHeaderIndices = stickyHeaderIndicesProp;
Expand All @@ -1260,23 +1284,23 @@ index 40e87cda8c9bc79a889e5542f29af429a24b24d4..90e0d1a9dfd07d0212aae308f547b9ff
const previousContentInsetEndAdjustmentRef = useRef(contentInsetEndAdjustmentResolved);
const alwaysRenderIndices = useMemo(() => {
const indices = getAlwaysRenderIndices(alwaysRender, dataProp, keyExtractor, anchoredEndSpace == null ? void 0 : anchoredEndSpace.anchorIndex);
@@ -7320,6 +7522,7 @@ var LegendListInner = typedForwardRef(function LegendListInner2(props, forwarded
@@ -7320,6 +7525,7 @@ var LegendListInner = typedForwardRef(function LegendListInner2(props, forwarded
contentContainerAlignItems: contentContainerStyle.alignItems,
contentInset,
contentInsetEndAdjustment: contentInsetEndAdjustmentResolved,
+ contentInsetStartAdjustment,
data: dataProp,
dataKey,
dataVersion,
@@ -7351,6 +7554,7 @@ var LegendListInner = typedForwardRef(function LegendListInner2(props, forwarded
@@ -7351,6 +7557,7 @@ var LegendListInner = typedForwardRef(function LegendListInner2(props, forwarded
renderItem,
rtl,
snapToIndices,
+ sizeComponentInternal,
stickyHeaderIndicesArr: stickyHeaderIndices != null ? stickyHeaderIndices : [],
stickyHeaderIndicesSet: useMemo(() => new Set(stickyHeaderIndices != null ? stickyHeaderIndices : []), [stickyHeaderIndices == null ? void 0 : stickyHeaderIndices.join(",")]),
stickyPositionComponentInternal,
@@ -7402,6 +7606,13 @@ var LegendListInner = typedForwardRef(function LegendListInner2(props, forwarded
@@ -7402,6 +7609,13 @@ var LegendListInner = typedForwardRef(function LegendListInner2(props, forwarded
return void 0;
}
const resolvedOffset = (_a4 = initialScroll.contentOffset) != null ? _a4 : resolveInitialScrollOffset(ctx, initialScroll);
Expand All @@ -1290,23 +1314,23 @@ index 40e87cda8c9bc79a889e5542f29af429a24b24d4..90e0d1a9dfd07d0212aae308f547b9ff
return usesBootstrapInitialScroll && ((_b2 = state.initialScrollSession) == null ? void 0 : _b2.kind) === "bootstrap" && Platform.OS === "web" ? void 0 : resolvedOffset;
}, [usesBootstrapInitialScroll]);
useLayoutEffect(() => {
@@ -7526,6 +7737,7 @@ var LegendListInner = typedForwardRef(function LegendListInner2(props, forwarded
@@ -7526,6 +7740,7 @@ var LegendListInner = typedForwardRef(function LegendListInner2(props, forwarded
[
dataKey,
dataVersion,
+ contentInsetStartAdjustment,
memoizedLastItemKeys.join(","),
numColumnsProp,
nextScrollAxisGap,
@@ -7622,6 +7834,7 @@ var LegendListInner = typedForwardRef(function LegendListInner2(props, forwarded
@@ -7622,6 +7837,7 @@ var LegendListInner = typedForwardRef(function LegendListInner2(props, forwarded
() => ({
getRenderedItem: (key) => getRenderedItem(ctx, key),
onMomentumScrollEnd: (event) => {
+ state.isMomentumScrolling = false;
checkFinishedScrollFallback(ctx);
if (state.props.onMomentumScrollEnd) {
state.props.onMomentumScrollEnd(event);
@@ -7630,6 +7843,8 @@ var LegendListInner = typedForwardRef(function LegendListInner2(props, forwarded
@@ -7630,6 +7846,8 @@ var LegendListInner = typedForwardRef(function LegendListInner2(props, forwarded
onScroll: (event) => onScroll(ctx, event),
onScrollBeginDrag: (event) => {
var _a4, _b2;
Expand All @@ -1315,7 +1339,7 @@ index 40e87cda8c9bc79a889e5542f29af429a24b24d4..90e0d1a9dfd07d0212aae308f547b9ff
prepareReachedEdgeForNextUserScroll(ctx);
(_b2 = (_a4 = state.props).onScrollBeginDrag) == null ? void 0 : _b2.call(_a4, event);
},
@@ -7655,11 +7870,18 @@ var LegendListInner = typedForwardRef(function LegendListInner2(props, forwarded
@@ -7655,11 +7873,18 @@ var LegendListInner = typedForwardRef(function LegendListInner2(props, forwarded
ListFooterComponent,
ListFooterComponentStyle,
ListHeaderComponent,
Expand Down
10 changes: 5 additions & 5 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading