@legendapp/list 3.0.0-beta.45 → 3.0.0-beta.47
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/index.js +15 -12
- package/index.mjs +15 -12
- package/index.native.js +52 -54
- package/index.native.mjs +53 -55
- package/package.json +1 -1
- package/react-native.js +52 -54
- package/react-native.mjs +53 -55
- package/react-native.web.js +15 -12
- package/react-native.web.mjs +15 -12
- package/react.js +15 -12
- package/react.mjs +15 -12
- package/reanimated.js +3 -3
- package/reanimated.mjs +3 -3
package/react-native.js
CHANGED
|
@@ -348,12 +348,7 @@ var PositionViewAnimated = typedMemo(function PositionViewAnimated2({
|
|
|
348
348
|
const position$ = useValue$(`containerPosition${id}`, {
|
|
349
349
|
getValue: (v) => v != null ? v : POSITION_OUT_OF_VIEW
|
|
350
350
|
});
|
|
351
|
-
|
|
352
|
-
if (ReactNative.Platform.OS === "ios" || ReactNative.Platform.OS === "android") {
|
|
353
|
-
position = horizontal ? { transform: [{ translateX: position$ }] } : { transform: [{ translateY: position$ }] };
|
|
354
|
-
} else {
|
|
355
|
-
position = horizontal ? { left: position$ } : { top: position$ };
|
|
356
|
-
}
|
|
351
|
+
const position = horizontal ? { left: position$ } : { top: position$ };
|
|
357
352
|
return /* @__PURE__ */ React2__namespace.createElement(ReactNative.Animated.View, { ref: refView, style: [style, position], ...rest });
|
|
358
353
|
});
|
|
359
354
|
var PositionViewSticky = typedMemo(function PositionViewSticky2({
|
|
@@ -384,12 +379,12 @@ var PositionViewSticky = typedMemo(function PositionViewSticky2({
|
|
|
384
379
|
if (animatedScrollY) {
|
|
385
380
|
const stickyConfigOffset = (_a3 = stickyHeaderConfig == null ? void 0 : stickyHeaderConfig.offset) != null ? _a3 : 0;
|
|
386
381
|
const stickyStart = position + headerSize + stylePaddingTop - stickyConfigOffset;
|
|
387
|
-
let
|
|
382
|
+
let nextStickyPosition;
|
|
388
383
|
if (pushLimit !== void 0) {
|
|
389
384
|
if (pushLimit <= position) {
|
|
390
|
-
|
|
385
|
+
nextStickyPosition = pushLimit;
|
|
391
386
|
} else {
|
|
392
|
-
|
|
387
|
+
nextStickyPosition = animatedScrollY.interpolate({
|
|
393
388
|
extrapolateLeft: "clamp",
|
|
394
389
|
extrapolateRight: "clamp",
|
|
395
390
|
inputRange: [stickyStart, stickyStart + (pushLimit - position)],
|
|
@@ -397,16 +392,16 @@ var PositionViewSticky = typedMemo(function PositionViewSticky2({
|
|
|
397
392
|
});
|
|
398
393
|
}
|
|
399
394
|
} else {
|
|
400
|
-
|
|
395
|
+
nextStickyPosition = animatedScrollY.interpolate({
|
|
401
396
|
extrapolateLeft: "clamp",
|
|
402
397
|
extrapolateRight: "extend",
|
|
403
398
|
inputRange: [stickyStart, stickyStart + 5e3],
|
|
404
399
|
outputRange: [position, position + 5e3]
|
|
405
400
|
});
|
|
406
401
|
}
|
|
407
|
-
return horizontal ? [{ translateX:
|
|
402
|
+
return horizontal ? [{ translateX: nextStickyPosition }] : [{ translateY: nextStickyPosition }];
|
|
408
403
|
}
|
|
409
|
-
}, [animatedScrollY, headerSize,
|
|
404
|
+
}, [animatedScrollY, headerSize, position, pushLimit, stylePaddingTop, stickyHeaderConfig == null ? void 0 : stickyHeaderConfig.offset]);
|
|
410
405
|
const viewStyle = React2__namespace.useMemo(() => [style, { zIndex: index + 1e3 }, { transform }], [style, transform]);
|
|
411
406
|
const renderStickyHeaderBackdrop = React2__namespace.useMemo(() => {
|
|
412
407
|
if (!(stickyHeaderConfig == null ? void 0 : stickyHeaderConfig.backdropComponent)) {
|
|
@@ -663,8 +658,8 @@ function useOnLayoutSync({
|
|
|
663
658
|
}
|
|
664
659
|
return { onLayout };
|
|
665
660
|
}
|
|
666
|
-
var
|
|
667
|
-
var PlatformAdjustBreaksScroll =
|
|
661
|
+
var Platform = ReactNative.Platform;
|
|
662
|
+
var PlatformAdjustBreaksScroll = Platform.OS === "android";
|
|
668
663
|
|
|
669
664
|
// src/utils/isInMVCPActiveMode.native.ts
|
|
670
665
|
function isInMVCPActiveMode(state) {
|
|
@@ -785,7 +780,7 @@ var Container = typedMemo(function Container2({
|
|
|
785
780
|
updateItemSizeFn(currentItemKey, layout);
|
|
786
781
|
itemLayoutRef.current.didLayout = true;
|
|
787
782
|
};
|
|
788
|
-
const shouldDeferWebShrinkLayoutUpdate =
|
|
783
|
+
const shouldDeferWebShrinkLayoutUpdate = Platform.OS === "web" && !isInMVCPActiveMode(ctx.state) && prevSize !== void 0 && size + 1 < prevSize;
|
|
789
784
|
if (shouldDeferWebShrinkLayoutUpdate) {
|
|
790
785
|
const token = pendingShrinkToken + 1;
|
|
791
786
|
itemLayoutRef.current.pendingShrinkToken = token;
|
|
@@ -1055,7 +1050,7 @@ var ListComponent = typedMemo(function ListComponent2({
|
|
|
1055
1050
|
}
|
|
1056
1051
|
),
|
|
1057
1052
|
ListFooterComponent && /* @__PURE__ */ React2__namespace.createElement(LayoutView, { onLayoutChange: onLayoutFooterInternal, style: ListFooterComponentStyle }, getComponent(ListFooterComponent)),
|
|
1058
|
-
|
|
1053
|
+
Platform.OS === "web" && /* @__PURE__ */ React2__namespace.createElement(WebAnchoredEndSpace, { horizontal }),
|
|
1059
1054
|
IS_DEV && ENABLE_DEVMODE
|
|
1060
1055
|
);
|
|
1061
1056
|
});
|
|
@@ -1093,7 +1088,7 @@ function useDevChecksImpl(props) {
|
|
|
1093
1088
|
const state = ctx.state;
|
|
1094
1089
|
const dataLength = state.props.data.length;
|
|
1095
1090
|
const useWindowScrollResolved = state.props.useWindowScroll;
|
|
1096
|
-
if (
|
|
1091
|
+
if (Platform.OS !== "web" || useWindowScrollResolved || dataLength < WEB_UNBOUNDED_HEIGHT_MIN_DATA_LENGTH) {
|
|
1097
1092
|
return;
|
|
1098
1093
|
}
|
|
1099
1094
|
const warnIfUnboundedOuterSize = () => {
|
|
@@ -1499,7 +1494,7 @@ function finishInitialScroll(ctx, options) {
|
|
|
1499
1494
|
}
|
|
1500
1495
|
const complete = () => {
|
|
1501
1496
|
var _a4, _b2, _c2, _d, _e;
|
|
1502
|
-
const shouldReleaseDeferredPublicOnScroll =
|
|
1497
|
+
const shouldReleaseDeferredPublicOnScroll = Platform.OS === "web" && ((_a4 = state.initialScrollSession) == null ? void 0 : _a4.kind) === "bootstrap";
|
|
1503
1498
|
const finalScrollOffset = (_d = (_c2 = (_b2 = options == null ? void 0 : options.resolvedOffset) != null ? _b2 : state.scrollPending) != null ? _c2 : state.scroll) != null ? _d : 0;
|
|
1504
1499
|
initialScrollWatchdog.clear(state);
|
|
1505
1500
|
if ((options == null ? void 0 : options.preserveTarget) && state.initialScroll) {
|
|
@@ -1691,7 +1686,7 @@ function clampScrollOffset(ctx, offset, scrollTarget) {
|
|
|
1691
1686
|
const state = ctx.state;
|
|
1692
1687
|
const contentSize = getContentSize(ctx);
|
|
1693
1688
|
let clampedOffset = offset;
|
|
1694
|
-
if (Number.isFinite(contentSize) && Number.isFinite(state.scrollLength) && (
|
|
1689
|
+
if (Number.isFinite(contentSize) && Number.isFinite(state.scrollLength) && (Platform.OS !== "android" || state.lastLayout)) {
|
|
1695
1690
|
const baseMaxOffset = Math.max(0, contentSize - state.scrollLength);
|
|
1696
1691
|
const viewOffset = scrollTarget == null ? void 0 : scrollTarget.viewOffset;
|
|
1697
1692
|
const extraEndOffset = typeof viewOffset === "number" && viewOffset < 0 ? -viewOffset : 0;
|
|
@@ -1858,7 +1853,7 @@ function checkFinishedScrollFallback(ctx) {
|
|
|
1858
1853
|
);
|
|
1859
1854
|
const completionState = getResolvedScrollCompletionState(ctx, isStillScrollingTo);
|
|
1860
1855
|
const canFinishAfterSilentNativeDispatch = silentInitialDispatch && completionState.isAtResolvedTarget && numChecks >= 1;
|
|
1861
|
-
const shouldRetrySilentInitialNativeScroll =
|
|
1856
|
+
const shouldRetrySilentInitialNativeScroll = Platform.OS === "android" && canFinishAfterSilentNativeDispatch && !initialScrollCompletion.didRetrySilentInitialScroll(state);
|
|
1862
1857
|
if (shouldRetrySilentInitialNativeScroll) {
|
|
1863
1858
|
const targetOffset = (_b = (_a3 = getInitialScrollWatchdogTargetOffset(state)) != null ? _a3 : isStillScrollingTo.targetOffset) != null ? _b : 0;
|
|
1864
1859
|
const jiggleOffset = targetOffset >= SILENT_INITIAL_SCROLL_TARGET_EPSILON ? targetOffset - SILENT_INITIAL_SCROLL_TARGET_EPSILON : targetOffset + SILENT_INITIAL_SCROLL_TARGET_EPSILON;
|
|
@@ -1976,7 +1971,7 @@ function scrollTo(ctx, params) {
|
|
|
1976
1971
|
}
|
|
1977
1972
|
state.scrollPending = targetOffset;
|
|
1978
1973
|
syncInitialScrollNativeWatchdog(state, { isInitialScroll, requestedOffset: offset, targetOffset });
|
|
1979
|
-
if (forceScroll || !isInitialScroll ||
|
|
1974
|
+
if (forceScroll || !isInitialScroll || Platform.OS === "android") {
|
|
1980
1975
|
doScrollTo(ctx, { animated, horizontal, isInitialScroll, offset });
|
|
1981
1976
|
} else {
|
|
1982
1977
|
state.scroll = offset;
|
|
@@ -2453,7 +2448,7 @@ function startBootstrapInitialScrollOnMount(ctx, options) {
|
|
|
2453
2448
|
} else {
|
|
2454
2449
|
startBootstrapInitialScrollSession(state, {
|
|
2455
2450
|
scroll: offset,
|
|
2456
|
-
seedContentOffset:
|
|
2451
|
+
seedContentOffset: Platform.OS === "web" ? 0 : offset,
|
|
2457
2452
|
targetIndexSeed: target.index
|
|
2458
2453
|
});
|
|
2459
2454
|
ensureBootstrapInitialScrollFrameTicker(ctx);
|
|
@@ -2650,7 +2645,7 @@ function evaluateBootstrapInitialScroll(ctx) {
|
|
|
2650
2645
|
queueBootstrapInitialScrollReevaluation(state);
|
|
2651
2646
|
return;
|
|
2652
2647
|
}
|
|
2653
|
-
if (
|
|
2648
|
+
if (Platform.OS !== "web" && Platform.OS !== "android" && Math.abs(bootstrapInitialScroll.seedContentOffset - resolvedOffset) <= 1 && Math.abs(getObservedBootstrapInitialScrollOffset(state) - resolvedOffset) <= 1) {
|
|
2654
2649
|
finishBootstrapInitialScrollWithoutScroll(ctx, resolvedOffset);
|
|
2655
2650
|
} else {
|
|
2656
2651
|
clearBootstrapInitialScrollSession(state);
|
|
@@ -2658,7 +2653,7 @@ function evaluateBootstrapInitialScroll(ctx) {
|
|
|
2658
2653
|
forceScroll: true,
|
|
2659
2654
|
resolvedOffset,
|
|
2660
2655
|
target: initialScroll,
|
|
2661
|
-
waitForCompletionFrame:
|
|
2656
|
+
waitForCompletionFrame: Platform.OS === "web"
|
|
2662
2657
|
});
|
|
2663
2658
|
}
|
|
2664
2659
|
}
|
|
@@ -2685,7 +2680,7 @@ function abortBootstrapInitialScroll(ctx) {
|
|
|
2685
2680
|
forceScroll: true,
|
|
2686
2681
|
resolvedOffset: bootstrapInitialScroll.scroll,
|
|
2687
2682
|
target: initialScroll,
|
|
2688
|
-
waitForCompletionFrame:
|
|
2683
|
+
waitForCompletionFrame: Platform.OS === "web"
|
|
2689
2684
|
});
|
|
2690
2685
|
} else {
|
|
2691
2686
|
finishBootstrapInitialScrollWithoutScroll(
|
|
@@ -2773,7 +2768,7 @@ function handleInitialScrollDataChange(ctx, options) {
|
|
|
2773
2768
|
function requestAdjust(ctx, positionDiff, dataChanged) {
|
|
2774
2769
|
const state = ctx.state;
|
|
2775
2770
|
if (Math.abs(positionDiff) > 0.1) {
|
|
2776
|
-
const needsScrollWorkaround =
|
|
2771
|
+
const needsScrollWorkaround = Platform.OS === "android" && !IsNewArchitecture && dataChanged && state.scroll <= positionDiff;
|
|
2777
2772
|
const doit = () => {
|
|
2778
2773
|
if (needsScrollWorkaround) {
|
|
2779
2774
|
scrollTo(ctx, {
|
|
@@ -2792,7 +2787,7 @@ function requestAdjust(ctx, positionDiff, dataChanged) {
|
|
|
2792
2787
|
const readyToRender = peek$(ctx, "readyToRender");
|
|
2793
2788
|
if (readyToRender) {
|
|
2794
2789
|
doit();
|
|
2795
|
-
if (
|
|
2790
|
+
if (Platform.OS !== "web") {
|
|
2796
2791
|
const threshold = state.scroll - positionDiff / 2;
|
|
2797
2792
|
if (!state.ignoreScrollFromMVCP) {
|
|
2798
2793
|
state.ignoreScrollFromMVCP = {};
|
|
@@ -2847,7 +2842,7 @@ function resolveAnchorLock(state, enableMVCPAnchorLock, mvcpData, now) {
|
|
|
2847
2842
|
return lock;
|
|
2848
2843
|
}
|
|
2849
2844
|
function updateAnchorLock(state, params) {
|
|
2850
|
-
if (
|
|
2845
|
+
if (Platform.OS === "web") {
|
|
2851
2846
|
const { anchorId, anchorPosition, dataChanged, now, positionDiff } = params;
|
|
2852
2847
|
const enableMVCPAnchorLock = !!dataChanged || !!state.mvcpAnchorLock;
|
|
2853
2848
|
const mvcpData = state.props.maintainVisibleContentPosition.data;
|
|
@@ -2869,7 +2864,7 @@ function updateAnchorLock(state, params) {
|
|
|
2869
2864
|
}
|
|
2870
2865
|
}
|
|
2871
2866
|
function shouldQueueNativeMVCPAdjust(dataChanged, state, positionDiff, prevTotalSize, prevScroll, scrollTarget) {
|
|
2872
|
-
if (!dataChanged ||
|
|
2867
|
+
if (!dataChanged || Platform.OS === "web" || !state.props.maintainVisibleContentPosition.data || scrollTarget !== void 0 || positionDiff >= -MVCP_POSITION_EPSILON) {
|
|
2873
2868
|
return false;
|
|
2874
2869
|
}
|
|
2875
2870
|
const distanceFromEnd = prevTotalSize - prevScroll - state.scrollLength;
|
|
@@ -2968,7 +2963,7 @@ function prepareMVCP(ctx, dataChanged) {
|
|
|
2968
2963
|
const {
|
|
2969
2964
|
maintainVisibleContentPosition: { data: mvcpData, size: mvcpScroll, shouldRestorePosition }
|
|
2970
2965
|
} = props;
|
|
2971
|
-
const isWeb =
|
|
2966
|
+
const isWeb = Platform.OS === "web";
|
|
2972
2967
|
const now = Date.now();
|
|
2973
2968
|
const enableMVCPAnchorLock = isWeb && (!!dataChanged || !!state.mvcpAnchorLock);
|
|
2974
2969
|
const scrollingTo = state.scrollingTo;
|
|
@@ -3383,7 +3378,7 @@ function updateItemPositions(ctx, dataChanged, { startIndex, scrollBottomBuffere
|
|
|
3383
3378
|
const layoutConfig = overrideItemLayout ? { span: 1 } : void 0;
|
|
3384
3379
|
const lastScrollDelta = state.lastScrollDelta;
|
|
3385
3380
|
const velocity = getScrollVelocity(state);
|
|
3386
|
-
const shouldOptimize = !forceFullUpdate && !dataChanged && (optimizeForVisibleWindow || Math.abs(velocity) > 0 ||
|
|
3381
|
+
const shouldOptimize = !forceFullUpdate && !dataChanged && (optimizeForVisibleWindow || Math.abs(velocity) > 0 || Platform.OS === "web" && state.scrollLength > 0 && lastScrollDelta > state.scrollLength);
|
|
3387
3382
|
const maxVisibleArea = scrollBottomBuffered + 1e3;
|
|
3388
3383
|
const useAverageSize = !getEstimatedItemSize;
|
|
3389
3384
|
const preferCachedSize = !doMVCP || dataChanged || state.scrollAdjustHandler.getAdjust() !== 0 || ((_b = peek$(ctx, "scrollAdjustPending")) != null ? _b : 0) !== 0;
|
|
@@ -3722,6 +3717,7 @@ function findAvailableContainers(ctx, numNeeded, startBuffered, endBuffered, pen
|
|
|
3722
3717
|
const numContainers = peek$(ctx, "numContainers");
|
|
3723
3718
|
const state = ctx.state;
|
|
3724
3719
|
const { stickyContainerPool, containerItemTypes } = state;
|
|
3720
|
+
const shouldAvoidAssignedContainerReuse = state.props.recycleItems && !!state.props.positionComponentInternal;
|
|
3725
3721
|
const result = [];
|
|
3726
3722
|
const availableContainers = [];
|
|
3727
3723
|
const pendingRemovalSet = new Set(pendingRemoval);
|
|
@@ -3778,18 +3774,20 @@ function findAvailableContainers(ctx, numNeeded, startBuffered, endBuffered, pen
|
|
|
3778
3774
|
}
|
|
3779
3775
|
}
|
|
3780
3776
|
}
|
|
3781
|
-
|
|
3782
|
-
|
|
3783
|
-
|
|
3784
|
-
|
|
3785
|
-
|
|
3786
|
-
|
|
3787
|
-
|
|
3788
|
-
|
|
3789
|
-
|
|
3790
|
-
|
|
3791
|
-
|
|
3792
|
-
|
|
3777
|
+
if (!shouldAvoidAssignedContainerReuse) {
|
|
3778
|
+
for (let u = 0; u < numContainers && result.length < numNeeded; u++) {
|
|
3779
|
+
if (stickyContainerPool.has(u)) {
|
|
3780
|
+
continue;
|
|
3781
|
+
}
|
|
3782
|
+
const key = peek$(ctx, `containerItemKey${u}`);
|
|
3783
|
+
if (key === void 0) continue;
|
|
3784
|
+
const index = state.indexByKey.get(key);
|
|
3785
|
+
const isOutOfView = index < startBuffered || index > endBuffered;
|
|
3786
|
+
if (isOutOfView) {
|
|
3787
|
+
const distance = index < startBuffered ? startBuffered - index : index - endBuffered;
|
|
3788
|
+
if (!requiredItemTypes || typeIndex < neededTypes.length && canReuseContainer(u, neededTypes[typeIndex])) {
|
|
3789
|
+
availableContainers.push({ distance, index: u });
|
|
3790
|
+
}
|
|
3793
3791
|
}
|
|
3794
3792
|
}
|
|
3795
3793
|
}
|
|
@@ -3994,7 +3992,7 @@ function calculateItemsInView(ctx, params = {}) {
|
|
|
3994
3992
|
if (top === null && bottom === null) {
|
|
3995
3993
|
state.scrollForNextCalculateItemsInView = void 0;
|
|
3996
3994
|
} else if ((top === null || scrollTopBuffered > top) && (bottom === null || scrollBottomBuffered < bottom)) {
|
|
3997
|
-
if (
|
|
3995
|
+
if (Platform.OS !== "web" || !isInMVCPActiveMode(state)) {
|
|
3998
3996
|
return;
|
|
3999
3997
|
}
|
|
4000
3998
|
}
|
|
@@ -4268,7 +4266,7 @@ function calculateItemsInView(ctx, params = {}) {
|
|
|
4268
4266
|
}
|
|
4269
4267
|
}
|
|
4270
4268
|
}
|
|
4271
|
-
if (
|
|
4269
|
+
if (Platform.OS === "web" && didChangePositions) {
|
|
4272
4270
|
set$(ctx, "lastPositionUpdate", Date.now());
|
|
4273
4271
|
}
|
|
4274
4272
|
if (suppressInitialScrollSideEffects) {
|
|
@@ -4582,7 +4580,7 @@ function updateScroll(ctx, newScroll, forceUpdate) {
|
|
|
4582
4580
|
(_a4 = state.triggerCalculateItemsInView) == null ? void 0 : _a4.call(state, { doMVCP: scrollingTo !== void 0 });
|
|
4583
4581
|
checkThresholds(ctx);
|
|
4584
4582
|
};
|
|
4585
|
-
if (
|
|
4583
|
+
if (Platform.OS === "web" && scrollLength > 0 && scrollingTo === void 0 && scrollDelta > scrollLength) {
|
|
4586
4584
|
flushSync(runCalculateItems);
|
|
4587
4585
|
} else {
|
|
4588
4586
|
runCalculateItems();
|
|
@@ -4615,7 +4613,7 @@ function trackInitialScrollNativeProgress(state, newScroll) {
|
|
|
4615
4613
|
}
|
|
4616
4614
|
function shouldDeferPublicOnScroll(state) {
|
|
4617
4615
|
var _a3;
|
|
4618
|
-
return
|
|
4616
|
+
return Platform.OS === "web" && !!state.initialScroll && ((_a3 = state.initialScrollSession) == null ? void 0 : _a3.kind) === "bootstrap" && !state.didFinishInitialScroll;
|
|
4619
4617
|
}
|
|
4620
4618
|
function cloneScrollEvent(event) {
|
|
4621
4619
|
return {
|
|
@@ -4765,7 +4763,7 @@ function maybeUpdateAnchoredEndSpace(ctx) {
|
|
|
4765
4763
|
// src/core/updateItemSize.ts
|
|
4766
4764
|
function runOrScheduleMVCPRecalculate(ctx) {
|
|
4767
4765
|
const state = ctx.state;
|
|
4768
|
-
if (
|
|
4766
|
+
if (Platform.OS === "web") {
|
|
4769
4767
|
if (!state.mvcpAnchorLock) {
|
|
4770
4768
|
if (state.queuedMVCPRecalculate !== void 0) {
|
|
4771
4769
|
cancelAnimationFrame(state.queuedMVCPRecalculate);
|
|
@@ -4891,7 +4889,7 @@ function updateOneItemSize(ctx, itemKey, sizeObj) {
|
|
|
4891
4889
|
const index = indexByKey.get(itemKey);
|
|
4892
4890
|
const prevSize = getItemSize(ctx, itemKey, index, data[index]);
|
|
4893
4891
|
const rawSize = horizontal ? sizeObj.width : sizeObj.height;
|
|
4894
|
-
const size =
|
|
4892
|
+
const size = Platform.OS === "web" ? Math.round(rawSize) : roundSize(rawSize);
|
|
4895
4893
|
const prevSizeKnown = sizesKnown.get(itemKey);
|
|
4896
4894
|
sizesKnown.set(itemKey, size);
|
|
4897
4895
|
if (!getEstimatedItemSize && !getFixedItemSize && size > 0) {
|
|
@@ -5515,7 +5513,7 @@ var LegendListInner = typedForwardRef(function LegendListInner2(props, forwarded
|
|
|
5515
5513
|
dataVersion,
|
|
5516
5514
|
keyExtractor
|
|
5517
5515
|
]);
|
|
5518
|
-
const useWindowScrollResolved =
|
|
5516
|
+
const useWindowScrollResolved = Platform.OS === "web" && !!useWindowScroll && !renderScrollComponent;
|
|
5519
5517
|
const refState = React2.useRef(void 0);
|
|
5520
5518
|
const hasOverrideItemLayout = !!overrideItemLayout;
|
|
5521
5519
|
const prevHasOverrideItemLayout = React2.useRef(hasOverrideItemLayout);
|
|
@@ -5611,7 +5609,7 @@ var LegendListInner = typedForwardRef(function LegendListInner2(props, forwarded
|
|
|
5611
5609
|
}
|
|
5612
5610
|
const throttledOnScroll = useThrottledOnScroll(onScrollProp != null ? onScrollProp : noopOnScroll, scrollEventThrottle != null ? scrollEventThrottle : 0);
|
|
5613
5611
|
const throttleScrollFn = scrollEventThrottle && onScrollProp ? throttledOnScroll : onScrollProp;
|
|
5614
|
-
const anchoredEndSpaceResolved =
|
|
5612
|
+
const anchoredEndSpaceResolved = Platform.OS === "web" && anchoredEndSpace ? { ...anchoredEndSpace, includeInEndInset: true } : anchoredEndSpace;
|
|
5615
5613
|
state.props = {
|
|
5616
5614
|
alignItemsAtEnd,
|
|
5617
5615
|
alwaysRender,
|
|
@@ -5671,7 +5669,7 @@ var LegendListInner = typedForwardRef(function LegendListInner2(props, forwarded
|
|
|
5671
5669
|
setPaddingTop(ctx, { stylePaddingTop: stylePaddingTopState });
|
|
5672
5670
|
refState.current.props.stylePaddingBottom = stylePaddingBottomState;
|
|
5673
5671
|
let paddingDiff = stylePaddingTopState - prevPaddingTop;
|
|
5674
|
-
if (shouldAdjustPadding && maintainVisibleContentPositionConfig.size && paddingDiff && prevPaddingTop !== void 0 &&
|
|
5672
|
+
if (shouldAdjustPadding && maintainVisibleContentPositionConfig.size && paddingDiff && prevPaddingTop !== void 0 && Platform.OS === "ios") {
|
|
5675
5673
|
if (state.scroll < 0) {
|
|
5676
5674
|
paddingDiff += state.scroll;
|
|
5677
5675
|
}
|
|
@@ -5693,7 +5691,7 @@ var LegendListInner = typedForwardRef(function LegendListInner2(props, forwarded
|
|
|
5693
5691
|
return void 0;
|
|
5694
5692
|
}
|
|
5695
5693
|
const resolvedOffset = (_a4 = initialScroll.contentOffset) != null ? _a4 : resolveInitialScrollOffset(ctx, initialScroll);
|
|
5696
|
-
return usesBootstrapInitialScroll && ((_b2 = state.initialScrollSession) == null ? void 0 : _b2.kind) === "bootstrap" &&
|
|
5694
|
+
return usesBootstrapInitialScroll && ((_b2 = state.initialScrollSession) == null ? void 0 : _b2.kind) === "bootstrap" && Platform.OS === "web" ? void 0 : resolvedOffset;
|
|
5697
5695
|
}, [usesBootstrapInitialScroll]);
|
|
5698
5696
|
React2.useLayoutEffect(() => {
|
|
5699
5697
|
initializeInitialScrollOnMount(ctx, {
|
|
@@ -5848,7 +5846,7 @@ var LegendListInner = typedForwardRef(function LegendListInner2(props, forwarded
|
|
|
5848
5846
|
});
|
|
5849
5847
|
React2.useImperativeHandle(forwardedRef, () => createImperativeHandle(ctx), []);
|
|
5850
5848
|
React2.useEffect(() => {
|
|
5851
|
-
if (
|
|
5849
|
+
if (Platform.OS !== "web" || usesBootstrapInitialScroll) {
|
|
5852
5850
|
return;
|
|
5853
5851
|
}
|
|
5854
5852
|
advanceCurrentInitialScrollSession(ctx);
|