@legendapp/list 3.0.0-beta.45 → 3.0.0-beta.46
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 +57 -56
- package/index.native.mjs +58 -57
- package/package.json +1 -1
- package/react-native.js +57 -56
- package/react-native.mjs +58 -57
- 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 +4 -4
- package/reanimated.mjs +4 -4
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({
|
|
@@ -379,17 +374,17 @@ var PositionViewSticky = typedMemo(function PositionViewSticky2({
|
|
|
379
374
|
() => getStickyPushLimit(ctx.state, index, itemKey),
|
|
380
375
|
[ctx.state, index, itemKey, _totalSize]
|
|
381
376
|
);
|
|
382
|
-
const
|
|
377
|
+
const stickyPosition = React2__namespace.useMemo(() => {
|
|
383
378
|
var _a3;
|
|
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,17 +392,20 @@ 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
|
|
402
|
+
return nextStickyPosition;
|
|
408
403
|
}
|
|
409
|
-
}, [animatedScrollY, headerSize,
|
|
410
|
-
const viewStyle = React2__namespace.useMemo(
|
|
404
|
+
}, [animatedScrollY, headerSize, position, pushLimit, stylePaddingTop, stickyHeaderConfig == null ? void 0 : stickyHeaderConfig.offset]);
|
|
405
|
+
const viewStyle = React2__namespace.useMemo(
|
|
406
|
+
() => [style, { zIndex: index + 1e3 }, horizontal ? { left: stickyPosition } : { top: stickyPosition }],
|
|
407
|
+
[horizontal, index, stickyPosition, style]
|
|
408
|
+
);
|
|
411
409
|
const renderStickyHeaderBackdrop = React2__namespace.useMemo(() => {
|
|
412
410
|
if (!(stickyHeaderConfig == null ? void 0 : stickyHeaderConfig.backdropComponent)) {
|
|
413
411
|
return null;
|
|
@@ -663,8 +661,8 @@ function useOnLayoutSync({
|
|
|
663
661
|
}
|
|
664
662
|
return { onLayout };
|
|
665
663
|
}
|
|
666
|
-
var
|
|
667
|
-
var PlatformAdjustBreaksScroll =
|
|
664
|
+
var Platform = ReactNative.Platform;
|
|
665
|
+
var PlatformAdjustBreaksScroll = Platform.OS === "android";
|
|
668
666
|
|
|
669
667
|
// src/utils/isInMVCPActiveMode.native.ts
|
|
670
668
|
function isInMVCPActiveMode(state) {
|
|
@@ -785,7 +783,7 @@ var Container = typedMemo(function Container2({
|
|
|
785
783
|
updateItemSizeFn(currentItemKey, layout);
|
|
786
784
|
itemLayoutRef.current.didLayout = true;
|
|
787
785
|
};
|
|
788
|
-
const shouldDeferWebShrinkLayoutUpdate =
|
|
786
|
+
const shouldDeferWebShrinkLayoutUpdate = Platform.OS === "web" && !isInMVCPActiveMode(ctx.state) && prevSize !== void 0 && size + 1 < prevSize;
|
|
789
787
|
if (shouldDeferWebShrinkLayoutUpdate) {
|
|
790
788
|
const token = pendingShrinkToken + 1;
|
|
791
789
|
itemLayoutRef.current.pendingShrinkToken = token;
|
|
@@ -1055,7 +1053,7 @@ var ListComponent = typedMemo(function ListComponent2({
|
|
|
1055
1053
|
}
|
|
1056
1054
|
),
|
|
1057
1055
|
ListFooterComponent && /* @__PURE__ */ React2__namespace.createElement(LayoutView, { onLayoutChange: onLayoutFooterInternal, style: ListFooterComponentStyle }, getComponent(ListFooterComponent)),
|
|
1058
|
-
|
|
1056
|
+
Platform.OS === "web" && /* @__PURE__ */ React2__namespace.createElement(WebAnchoredEndSpace, { horizontal }),
|
|
1059
1057
|
IS_DEV && ENABLE_DEVMODE
|
|
1060
1058
|
);
|
|
1061
1059
|
});
|
|
@@ -1093,7 +1091,7 @@ function useDevChecksImpl(props) {
|
|
|
1093
1091
|
const state = ctx.state;
|
|
1094
1092
|
const dataLength = state.props.data.length;
|
|
1095
1093
|
const useWindowScrollResolved = state.props.useWindowScroll;
|
|
1096
|
-
if (
|
|
1094
|
+
if (Platform.OS !== "web" || useWindowScrollResolved || dataLength < WEB_UNBOUNDED_HEIGHT_MIN_DATA_LENGTH) {
|
|
1097
1095
|
return;
|
|
1098
1096
|
}
|
|
1099
1097
|
const warnIfUnboundedOuterSize = () => {
|
|
@@ -1499,7 +1497,7 @@ function finishInitialScroll(ctx, options) {
|
|
|
1499
1497
|
}
|
|
1500
1498
|
const complete = () => {
|
|
1501
1499
|
var _a4, _b2, _c2, _d, _e;
|
|
1502
|
-
const shouldReleaseDeferredPublicOnScroll =
|
|
1500
|
+
const shouldReleaseDeferredPublicOnScroll = Platform.OS === "web" && ((_a4 = state.initialScrollSession) == null ? void 0 : _a4.kind) === "bootstrap";
|
|
1503
1501
|
const finalScrollOffset = (_d = (_c2 = (_b2 = options == null ? void 0 : options.resolvedOffset) != null ? _b2 : state.scrollPending) != null ? _c2 : state.scroll) != null ? _d : 0;
|
|
1504
1502
|
initialScrollWatchdog.clear(state);
|
|
1505
1503
|
if ((options == null ? void 0 : options.preserveTarget) && state.initialScroll) {
|
|
@@ -1691,7 +1689,7 @@ function clampScrollOffset(ctx, offset, scrollTarget) {
|
|
|
1691
1689
|
const state = ctx.state;
|
|
1692
1690
|
const contentSize = getContentSize(ctx);
|
|
1693
1691
|
let clampedOffset = offset;
|
|
1694
|
-
if (Number.isFinite(contentSize) && Number.isFinite(state.scrollLength) && (
|
|
1692
|
+
if (Number.isFinite(contentSize) && Number.isFinite(state.scrollLength) && (Platform.OS !== "android" || state.lastLayout)) {
|
|
1695
1693
|
const baseMaxOffset = Math.max(0, contentSize - state.scrollLength);
|
|
1696
1694
|
const viewOffset = scrollTarget == null ? void 0 : scrollTarget.viewOffset;
|
|
1697
1695
|
const extraEndOffset = typeof viewOffset === "number" && viewOffset < 0 ? -viewOffset : 0;
|
|
@@ -1858,7 +1856,7 @@ function checkFinishedScrollFallback(ctx) {
|
|
|
1858
1856
|
);
|
|
1859
1857
|
const completionState = getResolvedScrollCompletionState(ctx, isStillScrollingTo);
|
|
1860
1858
|
const canFinishAfterSilentNativeDispatch = silentInitialDispatch && completionState.isAtResolvedTarget && numChecks >= 1;
|
|
1861
|
-
const shouldRetrySilentInitialNativeScroll =
|
|
1859
|
+
const shouldRetrySilentInitialNativeScroll = Platform.OS === "android" && canFinishAfterSilentNativeDispatch && !initialScrollCompletion.didRetrySilentInitialScroll(state);
|
|
1862
1860
|
if (shouldRetrySilentInitialNativeScroll) {
|
|
1863
1861
|
const targetOffset = (_b = (_a3 = getInitialScrollWatchdogTargetOffset(state)) != null ? _a3 : isStillScrollingTo.targetOffset) != null ? _b : 0;
|
|
1864
1862
|
const jiggleOffset = targetOffset >= SILENT_INITIAL_SCROLL_TARGET_EPSILON ? targetOffset - SILENT_INITIAL_SCROLL_TARGET_EPSILON : targetOffset + SILENT_INITIAL_SCROLL_TARGET_EPSILON;
|
|
@@ -1976,7 +1974,7 @@ function scrollTo(ctx, params) {
|
|
|
1976
1974
|
}
|
|
1977
1975
|
state.scrollPending = targetOffset;
|
|
1978
1976
|
syncInitialScrollNativeWatchdog(state, { isInitialScroll, requestedOffset: offset, targetOffset });
|
|
1979
|
-
if (forceScroll || !isInitialScroll ||
|
|
1977
|
+
if (forceScroll || !isInitialScroll || Platform.OS === "android") {
|
|
1980
1978
|
doScrollTo(ctx, { animated, horizontal, isInitialScroll, offset });
|
|
1981
1979
|
} else {
|
|
1982
1980
|
state.scroll = offset;
|
|
@@ -2453,7 +2451,7 @@ function startBootstrapInitialScrollOnMount(ctx, options) {
|
|
|
2453
2451
|
} else {
|
|
2454
2452
|
startBootstrapInitialScrollSession(state, {
|
|
2455
2453
|
scroll: offset,
|
|
2456
|
-
seedContentOffset:
|
|
2454
|
+
seedContentOffset: Platform.OS === "web" ? 0 : offset,
|
|
2457
2455
|
targetIndexSeed: target.index
|
|
2458
2456
|
});
|
|
2459
2457
|
ensureBootstrapInitialScrollFrameTicker(ctx);
|
|
@@ -2650,7 +2648,7 @@ function evaluateBootstrapInitialScroll(ctx) {
|
|
|
2650
2648
|
queueBootstrapInitialScrollReevaluation(state);
|
|
2651
2649
|
return;
|
|
2652
2650
|
}
|
|
2653
|
-
if (
|
|
2651
|
+
if (Platform.OS !== "web" && Platform.OS !== "android" && Math.abs(bootstrapInitialScroll.seedContentOffset - resolvedOffset) <= 1 && Math.abs(getObservedBootstrapInitialScrollOffset(state) - resolvedOffset) <= 1) {
|
|
2654
2652
|
finishBootstrapInitialScrollWithoutScroll(ctx, resolvedOffset);
|
|
2655
2653
|
} else {
|
|
2656
2654
|
clearBootstrapInitialScrollSession(state);
|
|
@@ -2658,7 +2656,7 @@ function evaluateBootstrapInitialScroll(ctx) {
|
|
|
2658
2656
|
forceScroll: true,
|
|
2659
2657
|
resolvedOffset,
|
|
2660
2658
|
target: initialScroll,
|
|
2661
|
-
waitForCompletionFrame:
|
|
2659
|
+
waitForCompletionFrame: Platform.OS === "web"
|
|
2662
2660
|
});
|
|
2663
2661
|
}
|
|
2664
2662
|
}
|
|
@@ -2685,7 +2683,7 @@ function abortBootstrapInitialScroll(ctx) {
|
|
|
2685
2683
|
forceScroll: true,
|
|
2686
2684
|
resolvedOffset: bootstrapInitialScroll.scroll,
|
|
2687
2685
|
target: initialScroll,
|
|
2688
|
-
waitForCompletionFrame:
|
|
2686
|
+
waitForCompletionFrame: Platform.OS === "web"
|
|
2689
2687
|
});
|
|
2690
2688
|
} else {
|
|
2691
2689
|
finishBootstrapInitialScrollWithoutScroll(
|
|
@@ -2773,7 +2771,7 @@ function handleInitialScrollDataChange(ctx, options) {
|
|
|
2773
2771
|
function requestAdjust(ctx, positionDiff, dataChanged) {
|
|
2774
2772
|
const state = ctx.state;
|
|
2775
2773
|
if (Math.abs(positionDiff) > 0.1) {
|
|
2776
|
-
const needsScrollWorkaround =
|
|
2774
|
+
const needsScrollWorkaround = Platform.OS === "android" && !IsNewArchitecture && dataChanged && state.scroll <= positionDiff;
|
|
2777
2775
|
const doit = () => {
|
|
2778
2776
|
if (needsScrollWorkaround) {
|
|
2779
2777
|
scrollTo(ctx, {
|
|
@@ -2792,7 +2790,7 @@ function requestAdjust(ctx, positionDiff, dataChanged) {
|
|
|
2792
2790
|
const readyToRender = peek$(ctx, "readyToRender");
|
|
2793
2791
|
if (readyToRender) {
|
|
2794
2792
|
doit();
|
|
2795
|
-
if (
|
|
2793
|
+
if (Platform.OS !== "web") {
|
|
2796
2794
|
const threshold = state.scroll - positionDiff / 2;
|
|
2797
2795
|
if (!state.ignoreScrollFromMVCP) {
|
|
2798
2796
|
state.ignoreScrollFromMVCP = {};
|
|
@@ -2847,7 +2845,7 @@ function resolveAnchorLock(state, enableMVCPAnchorLock, mvcpData, now) {
|
|
|
2847
2845
|
return lock;
|
|
2848
2846
|
}
|
|
2849
2847
|
function updateAnchorLock(state, params) {
|
|
2850
|
-
if (
|
|
2848
|
+
if (Platform.OS === "web") {
|
|
2851
2849
|
const { anchorId, anchorPosition, dataChanged, now, positionDiff } = params;
|
|
2852
2850
|
const enableMVCPAnchorLock = !!dataChanged || !!state.mvcpAnchorLock;
|
|
2853
2851
|
const mvcpData = state.props.maintainVisibleContentPosition.data;
|
|
@@ -2869,7 +2867,7 @@ function updateAnchorLock(state, params) {
|
|
|
2869
2867
|
}
|
|
2870
2868
|
}
|
|
2871
2869
|
function shouldQueueNativeMVCPAdjust(dataChanged, state, positionDiff, prevTotalSize, prevScroll, scrollTarget) {
|
|
2872
|
-
if (!dataChanged ||
|
|
2870
|
+
if (!dataChanged || Platform.OS === "web" || !state.props.maintainVisibleContentPosition.data || scrollTarget !== void 0 || positionDiff >= -MVCP_POSITION_EPSILON) {
|
|
2873
2871
|
return false;
|
|
2874
2872
|
}
|
|
2875
2873
|
const distanceFromEnd = prevTotalSize - prevScroll - state.scrollLength;
|
|
@@ -2968,7 +2966,7 @@ function prepareMVCP(ctx, dataChanged) {
|
|
|
2968
2966
|
const {
|
|
2969
2967
|
maintainVisibleContentPosition: { data: mvcpData, size: mvcpScroll, shouldRestorePosition }
|
|
2970
2968
|
} = props;
|
|
2971
|
-
const isWeb =
|
|
2969
|
+
const isWeb = Platform.OS === "web";
|
|
2972
2970
|
const now = Date.now();
|
|
2973
2971
|
const enableMVCPAnchorLock = isWeb && (!!dataChanged || !!state.mvcpAnchorLock);
|
|
2974
2972
|
const scrollingTo = state.scrollingTo;
|
|
@@ -3383,7 +3381,7 @@ function updateItemPositions(ctx, dataChanged, { startIndex, scrollBottomBuffere
|
|
|
3383
3381
|
const layoutConfig = overrideItemLayout ? { span: 1 } : void 0;
|
|
3384
3382
|
const lastScrollDelta = state.lastScrollDelta;
|
|
3385
3383
|
const velocity = getScrollVelocity(state);
|
|
3386
|
-
const shouldOptimize = !forceFullUpdate && !dataChanged && (optimizeForVisibleWindow || Math.abs(velocity) > 0 ||
|
|
3384
|
+
const shouldOptimize = !forceFullUpdate && !dataChanged && (optimizeForVisibleWindow || Math.abs(velocity) > 0 || Platform.OS === "web" && state.scrollLength > 0 && lastScrollDelta > state.scrollLength);
|
|
3387
3385
|
const maxVisibleArea = scrollBottomBuffered + 1e3;
|
|
3388
3386
|
const useAverageSize = !getEstimatedItemSize;
|
|
3389
3387
|
const preferCachedSize = !doMVCP || dataChanged || state.scrollAdjustHandler.getAdjust() !== 0 || ((_b = peek$(ctx, "scrollAdjustPending")) != null ? _b : 0) !== 0;
|
|
@@ -3722,6 +3720,7 @@ function findAvailableContainers(ctx, numNeeded, startBuffered, endBuffered, pen
|
|
|
3722
3720
|
const numContainers = peek$(ctx, "numContainers");
|
|
3723
3721
|
const state = ctx.state;
|
|
3724
3722
|
const { stickyContainerPool, containerItemTypes } = state;
|
|
3723
|
+
const shouldAvoidAssignedContainerReuse = state.props.recycleItems && !!state.props.positionComponentInternal;
|
|
3725
3724
|
const result = [];
|
|
3726
3725
|
const availableContainers = [];
|
|
3727
3726
|
const pendingRemovalSet = new Set(pendingRemoval);
|
|
@@ -3778,18 +3777,20 @@ function findAvailableContainers(ctx, numNeeded, startBuffered, endBuffered, pen
|
|
|
3778
3777
|
}
|
|
3779
3778
|
}
|
|
3780
3779
|
}
|
|
3781
|
-
|
|
3782
|
-
|
|
3783
|
-
|
|
3784
|
-
|
|
3785
|
-
|
|
3786
|
-
|
|
3787
|
-
|
|
3788
|
-
|
|
3789
|
-
|
|
3790
|
-
|
|
3791
|
-
|
|
3792
|
-
|
|
3780
|
+
if (!shouldAvoidAssignedContainerReuse) {
|
|
3781
|
+
for (let u = 0; u < numContainers && result.length < numNeeded; u++) {
|
|
3782
|
+
if (stickyContainerPool.has(u)) {
|
|
3783
|
+
continue;
|
|
3784
|
+
}
|
|
3785
|
+
const key = peek$(ctx, `containerItemKey${u}`);
|
|
3786
|
+
if (key === void 0) continue;
|
|
3787
|
+
const index = state.indexByKey.get(key);
|
|
3788
|
+
const isOutOfView = index < startBuffered || index > endBuffered;
|
|
3789
|
+
if (isOutOfView) {
|
|
3790
|
+
const distance = index < startBuffered ? startBuffered - index : index - endBuffered;
|
|
3791
|
+
if (!requiredItemTypes || typeIndex < neededTypes.length && canReuseContainer(u, neededTypes[typeIndex])) {
|
|
3792
|
+
availableContainers.push({ distance, index: u });
|
|
3793
|
+
}
|
|
3793
3794
|
}
|
|
3794
3795
|
}
|
|
3795
3796
|
}
|
|
@@ -3994,7 +3995,7 @@ function calculateItemsInView(ctx, params = {}) {
|
|
|
3994
3995
|
if (top === null && bottom === null) {
|
|
3995
3996
|
state.scrollForNextCalculateItemsInView = void 0;
|
|
3996
3997
|
} else if ((top === null || scrollTopBuffered > top) && (bottom === null || scrollBottomBuffered < bottom)) {
|
|
3997
|
-
if (
|
|
3998
|
+
if (Platform.OS !== "web" || !isInMVCPActiveMode(state)) {
|
|
3998
3999
|
return;
|
|
3999
4000
|
}
|
|
4000
4001
|
}
|
|
@@ -4268,7 +4269,7 @@ function calculateItemsInView(ctx, params = {}) {
|
|
|
4268
4269
|
}
|
|
4269
4270
|
}
|
|
4270
4271
|
}
|
|
4271
|
-
if (
|
|
4272
|
+
if (Platform.OS === "web" && didChangePositions) {
|
|
4272
4273
|
set$(ctx, "lastPositionUpdate", Date.now());
|
|
4273
4274
|
}
|
|
4274
4275
|
if (suppressInitialScrollSideEffects) {
|
|
@@ -4582,7 +4583,7 @@ function updateScroll(ctx, newScroll, forceUpdate) {
|
|
|
4582
4583
|
(_a4 = state.triggerCalculateItemsInView) == null ? void 0 : _a4.call(state, { doMVCP: scrollingTo !== void 0 });
|
|
4583
4584
|
checkThresholds(ctx);
|
|
4584
4585
|
};
|
|
4585
|
-
if (
|
|
4586
|
+
if (Platform.OS === "web" && scrollLength > 0 && scrollingTo === void 0 && scrollDelta > scrollLength) {
|
|
4586
4587
|
flushSync(runCalculateItems);
|
|
4587
4588
|
} else {
|
|
4588
4589
|
runCalculateItems();
|
|
@@ -4615,7 +4616,7 @@ function trackInitialScrollNativeProgress(state, newScroll) {
|
|
|
4615
4616
|
}
|
|
4616
4617
|
function shouldDeferPublicOnScroll(state) {
|
|
4617
4618
|
var _a3;
|
|
4618
|
-
return
|
|
4619
|
+
return Platform.OS === "web" && !!state.initialScroll && ((_a3 = state.initialScrollSession) == null ? void 0 : _a3.kind) === "bootstrap" && !state.didFinishInitialScroll;
|
|
4619
4620
|
}
|
|
4620
4621
|
function cloneScrollEvent(event) {
|
|
4621
4622
|
return {
|
|
@@ -4765,7 +4766,7 @@ function maybeUpdateAnchoredEndSpace(ctx) {
|
|
|
4765
4766
|
// src/core/updateItemSize.ts
|
|
4766
4767
|
function runOrScheduleMVCPRecalculate(ctx) {
|
|
4767
4768
|
const state = ctx.state;
|
|
4768
|
-
if (
|
|
4769
|
+
if (Platform.OS === "web") {
|
|
4769
4770
|
if (!state.mvcpAnchorLock) {
|
|
4770
4771
|
if (state.queuedMVCPRecalculate !== void 0) {
|
|
4771
4772
|
cancelAnimationFrame(state.queuedMVCPRecalculate);
|
|
@@ -4891,7 +4892,7 @@ function updateOneItemSize(ctx, itemKey, sizeObj) {
|
|
|
4891
4892
|
const index = indexByKey.get(itemKey);
|
|
4892
4893
|
const prevSize = getItemSize(ctx, itemKey, index, data[index]);
|
|
4893
4894
|
const rawSize = horizontal ? sizeObj.width : sizeObj.height;
|
|
4894
|
-
const size =
|
|
4895
|
+
const size = Platform.OS === "web" ? Math.round(rawSize) : roundSize(rawSize);
|
|
4895
4896
|
const prevSizeKnown = sizesKnown.get(itemKey);
|
|
4896
4897
|
sizesKnown.set(itemKey, size);
|
|
4897
4898
|
if (!getEstimatedItemSize && !getFixedItemSize && size > 0) {
|
|
@@ -5515,7 +5516,7 @@ var LegendListInner = typedForwardRef(function LegendListInner2(props, forwarded
|
|
|
5515
5516
|
dataVersion,
|
|
5516
5517
|
keyExtractor
|
|
5517
5518
|
]);
|
|
5518
|
-
const useWindowScrollResolved =
|
|
5519
|
+
const useWindowScrollResolved = Platform.OS === "web" && !!useWindowScroll && !renderScrollComponent;
|
|
5519
5520
|
const refState = React2.useRef(void 0);
|
|
5520
5521
|
const hasOverrideItemLayout = !!overrideItemLayout;
|
|
5521
5522
|
const prevHasOverrideItemLayout = React2.useRef(hasOverrideItemLayout);
|
|
@@ -5611,7 +5612,7 @@ var LegendListInner = typedForwardRef(function LegendListInner2(props, forwarded
|
|
|
5611
5612
|
}
|
|
5612
5613
|
const throttledOnScroll = useThrottledOnScroll(onScrollProp != null ? onScrollProp : noopOnScroll, scrollEventThrottle != null ? scrollEventThrottle : 0);
|
|
5613
5614
|
const throttleScrollFn = scrollEventThrottle && onScrollProp ? throttledOnScroll : onScrollProp;
|
|
5614
|
-
const anchoredEndSpaceResolved =
|
|
5615
|
+
const anchoredEndSpaceResolved = Platform.OS === "web" && anchoredEndSpace ? { ...anchoredEndSpace, includeInEndInset: true } : anchoredEndSpace;
|
|
5615
5616
|
state.props = {
|
|
5616
5617
|
alignItemsAtEnd,
|
|
5617
5618
|
alwaysRender,
|
|
@@ -5671,7 +5672,7 @@ var LegendListInner = typedForwardRef(function LegendListInner2(props, forwarded
|
|
|
5671
5672
|
setPaddingTop(ctx, { stylePaddingTop: stylePaddingTopState });
|
|
5672
5673
|
refState.current.props.stylePaddingBottom = stylePaddingBottomState;
|
|
5673
5674
|
let paddingDiff = stylePaddingTopState - prevPaddingTop;
|
|
5674
|
-
if (shouldAdjustPadding && maintainVisibleContentPositionConfig.size && paddingDiff && prevPaddingTop !== void 0 &&
|
|
5675
|
+
if (shouldAdjustPadding && maintainVisibleContentPositionConfig.size && paddingDiff && prevPaddingTop !== void 0 && Platform.OS === "ios") {
|
|
5675
5676
|
if (state.scroll < 0) {
|
|
5676
5677
|
paddingDiff += state.scroll;
|
|
5677
5678
|
}
|
|
@@ -5693,7 +5694,7 @@ var LegendListInner = typedForwardRef(function LegendListInner2(props, forwarded
|
|
|
5693
5694
|
return void 0;
|
|
5694
5695
|
}
|
|
5695
5696
|
const resolvedOffset = (_a4 = initialScroll.contentOffset) != null ? _a4 : resolveInitialScrollOffset(ctx, initialScroll);
|
|
5696
|
-
return usesBootstrapInitialScroll && ((_b2 = state.initialScrollSession) == null ? void 0 : _b2.kind) === "bootstrap" &&
|
|
5697
|
+
return usesBootstrapInitialScroll && ((_b2 = state.initialScrollSession) == null ? void 0 : _b2.kind) === "bootstrap" && Platform.OS === "web" ? void 0 : resolvedOffset;
|
|
5697
5698
|
}, [usesBootstrapInitialScroll]);
|
|
5698
5699
|
React2.useLayoutEffect(() => {
|
|
5699
5700
|
initializeInitialScrollOnMount(ctx, {
|
|
@@ -5848,7 +5849,7 @@ var LegendListInner = typedForwardRef(function LegendListInner2(props, forwarded
|
|
|
5848
5849
|
});
|
|
5849
5850
|
React2.useImperativeHandle(forwardedRef, () => createImperativeHandle(ctx), []);
|
|
5850
5851
|
React2.useEffect(() => {
|
|
5851
|
-
if (
|
|
5852
|
+
if (Platform.OS !== "web" || usesBootstrapInitialScroll) {
|
|
5852
5853
|
return;
|
|
5853
5854
|
}
|
|
5854
5855
|
advanceCurrentInitialScrollSession(ctx);
|