| ... | @@ -241,10 +241,35 @@ index ce1fe00001c9e5aee6c6ea8bb2d4757d4586d002..3ccf6f16067152dfcb0c143371e2ec6a | ... | @@ -241,10 +241,35 @@ index ce1fe00001c9e5aee6c6ea8bb2d4757d4586d002..3ccf6f16067152dfcb0c143371e2ec6a |
| 241 | * Number of columns to render items in. | 241 | * Number of columns to render items in. |
| 242 | * @default 1 | 242 | * @default 1 |
| 243 | diff --git a/react-native.js b/react-native.js | 243 | diff --git a/react-native.js b/react-native.js |
| 244 | index b3c5a306b293f797a8b338adfca3060c0f6db22b..eb51ff0c375d7e5bd3473fca83995c7c3ffe83af 100644 | 244 | index b3c5a306b293f797a8b338adfca3060c0f6db22b..24d0763aef074411eb7d17f0feb8df752a843de0 100644 |
| 245 | --- a/react-native.js | 245 | --- a/react-native.js |
| 246 | +++ b/react-native.js | 246 | +++ b/react-native.js |
| 247 | @@ -954,7 +954,7 @@ function setInitialRenderState(ctx, { | 247 | @@ -717,6 +717,15 @@ function hasActiveInitialScroll(state) { |
| | 248 | return !!(state == null ? void 0 : state.initialScroll) && !state.didFinishInitialScroll; |
| | 249 | } |
| | 250 | |
| | 251 | +// Size-only changes may not emit a scroll event to refresh the edge signal. |
| | 252 | +function getIsAtEnd(ctx, contentSize = getContentSize(ctx)) { |
| | 253 | + const { queuedInitialLayout, scroll, scrollLength } = ctx.state; |
| | 254 | + if (!(contentSize > 0 && queuedInitialLayout)) { |
| | 255 | + return peek$(ctx, "isAtEnd"); |
| | 256 | + } |
| | 257 | + return contentSize < scrollLength || contentSize - scroll - scrollLength - getContentInsetEnd(ctx) <= EDGE_POSITION_EPSILON; |
| | 258 | +} |
| | 259 | + |
| | 260 | // src/utils/checkAtBottom.ts |
| | 261 | function checkAtBottom(ctx, allowedEdge, allowGateCreatedInCurrentCheck) { |
| | 262 | var _a3; |
| | 263 | @@ -737,7 +746,7 @@ function checkAtBottom(ctx, allowedEdge, allowGateCreatedInCurrentCheck) { |
| | 264 | const insetEnd = getContentInsetEnd(ctx); |
| | 265 | const distanceFromEnd = contentSize - scroll - scrollLength - insetEnd; |
| | 266 | const isContentLess = contentSize < scrollLength; |
| | 267 | - set$(ctx, "isAtEnd", isContentLess || distanceFromEnd <= EDGE_POSITION_EPSILON); |
| | 268 | + set$(ctx, "isAtEnd", getIsAtEnd(ctx, contentSize)); |
| | 269 | set$(ctx, "isNearEnd", isContentLess || distanceFromEnd <= onEndReachedThreshold * scrollLength); |
| | 270 | set$( |
| | 271 | ctx, |
| | 272 | @@ -954,7 +963,7 @@ function setInitialRenderState(ctx, { |
| 248 | if (didInitialScroll) { | 273 | if (didInitialScroll) { |
| 249 | state.didFinishInitialScroll = true; | 274 | state.didFinishInitialScroll = true; |
| 250 | } | 275 | } |
| ... | @@ -253,7 +278,7 @@ index b3c5a306b293f797a8b338adfca3060c0f6db22b..eb51ff0c375d7e5bd3473fca83995c7c | ... | @@ -253,7 +278,7 @@ index b3c5a306b293f797a8b338adfca3060c0f6db22b..eb51ff0c375d7e5bd3473fca83995c7c |
| 253 | if (isReadyToRender && !peek$(ctx, "readyToRender")) { | 278 | if (isReadyToRender && !peek$(ctx, "readyToRender")) { |
| 254 | set$(ctx, "readyToRender", true); | 279 | set$(ctx, "readyToRender", true); |
| 255 | setAdaptiveRender(ctx, "normal", "ready"); | 280 | setAdaptiveRender(ctx, "normal", "ready"); |
| 256 | @@ -1090,7 +1090,7 @@ function getRawContentLength(ctx) { | 281 | @@ -1090,7 +1099,7 @@ function getRawContentLength(ctx) { |
| 257 | function getAlignItemsAtEndPadding(ctx) { | 282 | function getAlignItemsAtEndPadding(ctx) { |
| 258 | const { state } = ctx; | 283 | const { state } = ctx; |
| 259 | const shouldPad = !!state.props.alignItemsAtEndPaddingEnabled && !state.props.horizontal && state.props.data.length > 0 && state.scrollLength > 0; | 284 | const shouldPad = !!state.props.alignItemsAtEndPaddingEnabled && !state.props.horizontal && state.props.data.length > 0 && state.scrollLength > 0; |
| ... | @@ -262,7 +287,7 @@ index b3c5a306b293f797a8b338adfca3060c0f6db22b..eb51ff0c375d7e5bd3473fca83995c7c | ... | @@ -262,7 +287,7 @@ index b3c5a306b293f797a8b338adfca3060c0f6db22b..eb51ff0c375d7e5bd3473fca83995c7c |
| 262 | } | 287 | } |
| 263 | function updateContentMetricsState(ctx) { | 288 | function updateContentMetricsState(ctx) { |
| 264 | const previousPadding = peek$(ctx, "alignItemsAtEndPadding") || 0; | 289 | const previousPadding = peek$(ctx, "alignItemsAtEndPadding") || 0; |
| 265 | @@ -1115,6 +1115,10 @@ function addTotalSize(ctx, key, add, notifyTotalSize = true) { | 290 | @@ -1115,6 +1124,10 @@ function addTotalSize(ctx, key, add, notifyTotalSize = true) { |
| 266 | totalSize += add; | 291 | totalSize += add; |
| 267 | } | 292 | } |
| 268 | if (prevTotalSize !== totalSize) { | 293 | if (prevTotalSize !== totalSize) { |
| ... | @@ -273,7 +298,7 @@ index b3c5a306b293f797a8b338adfca3060c0f6db22b..eb51ff0c375d7e5bd3473fca83995c7c | ... | @@ -273,7 +298,7 @@ index b3c5a306b293f797a8b338adfca3060c0f6db22b..eb51ff0c375d7e5bd3473fca83995c7c |
| 273 | if (!IsNewArchitecture && state.initialScroll && totalSize < prevTotalSize) { | 298 | if (!IsNewArchitecture && state.initialScroll && totalSize < prevTotalSize) { |
| 274 | state.pendingTotalSize = totalSize; | 299 | state.pendingTotalSize = totalSize; |
| 275 | } else { | 300 | } else { |
| 276 | @@ -1304,18 +1308,23 @@ function calculateOffsetWithOffsetPosition(ctx, offsetParam, params) { | 301 | @@ -1304,18 +1317,23 @@ function calculateOffsetWithOffsetPosition(ctx, offsetParam, params) { |
| 277 | } | 302 | } |
| 278 | | 303 | |
| 279 | // src/core/clampScrollOffset.ts | 304 | // src/core/clampScrollOffset.ts |
| ... | @@ -299,7 +324,7 @@ index b3c5a306b293f797a8b338adfca3060c0f6db22b..eb51ff0c375d7e5bd3473fca83995c7c | ... | @@ -299,7 +324,7 @@ index b3c5a306b293f797a8b338adfca3060c0f6db22b..eb51ff0c375d7e5bd3473fca83995c7c |
| 299 | return clampedOffset; | 324 | return clampedOffset; |
| 300 | } | 325 | } |
| 301 | | 326 | |
| 302 | @@ -1451,10 +1460,10 @@ function checkFinishedScrollFrame(ctx) { | 327 | @@ -1451,10 +1469,10 @@ function checkFinishedScrollFrame(ctx) { |
| 303 | finishScrollTo(ctx); | 328 | finishScrollTo(ctx); |
| 304 | } | 329 | } |
| 305 | } | 330 | } |
| ... | @@ -312,7 +337,7 @@ index b3c5a306b293f797a8b338adfca3060c0f6db22b..eb51ff0c375d7e5bd3473fca83995c7c | ... | @@ -312,7 +337,7 @@ index b3c5a306b293f797a8b338adfca3060c0f6db22b..eb51ff0c375d7e5bd3473fca83995c7c |
| 312 | x: ctx.state.props.horizontal ? offset : 0, | 337 | x: ctx.state.props.horizontal ? offset : 0, |
| 313 | y: ctx.state.props.horizontal ? 0 : offset | 338 | y: ctx.state.props.horizontal ? 0 : offset |
| 314 | }); | 339 | }); |
| 315 | @@ -1503,7 +1512,10 @@ function checkFinishedScrollFallback(ctx) { | 340 | @@ -1503,7 +1521,10 @@ function checkFinishedScrollFallback(ctx) { |
| 316 | ); | 341 | ); |
| 317 | scheduleFallbackCheck(SILENT_INITIAL_SCROLL_RETRY_DELAY_MS); | 342 | scheduleFallbackCheck(SILENT_INITIAL_SCROLL_RETRY_DELAY_MS); |
| 318 | } else if (shouldRetryUnalignedEndScroll) { | 343 | } else if (shouldRetryUnalignedEndScroll) { |
| ... | @@ -324,7 +349,7 @@ index b3c5a306b293f797a8b338adfca3060c0f6db22b..eb51ff0c375d7e5bd3473fca83995c7c | ... | @@ -324,7 +349,7 @@ index b3c5a306b293f797a8b338adfca3060c0f6db22b..eb51ff0c375d7e5bd3473fca83995c7c |
| 324 | scheduleFallbackCheck(100); | 349 | scheduleFallbackCheck(100); |
| 325 | } else if (shouldFinishZeroTarget || shouldFinishAfterObservedScroll || canFinishInitialScrollWithoutNativeProgress || canFinishAfterSilentNativeDispatch || numChecks > maxChecks) { | 350 | } else if (shouldFinishZeroTarget || shouldFinishAfterObservedScroll || canFinishInitialScrollWithoutNativeProgress || canFinishAfterSilentNativeDispatch || numChecks > maxChecks) { |
| 326 | finishScrollTo(ctx); | 351 | finishScrollTo(ctx); |
| 327 | @@ -1560,15 +1572,28 @@ function doMaintainScrollAtEnd(ctx) { | 352 | @@ -1560,15 +1581,28 @@ function doMaintainScrollAtEnd(ctx) { |
| 328 | } = state; | 353 | } = state; |
| 329 | const isWithinMaintainScrollAtEndThreshold = peek$(ctx, "isWithinMaintainScrollAtEndThreshold"); | 354 | const isWithinMaintainScrollAtEndThreshold = peek$(ctx, "isWithinMaintainScrollAtEndThreshold"); |
| 330 | const shouldMaintainScrollAtEnd = !!(isWithinMaintainScrollAtEndThreshold && maintainScrollAtEnd && didContainersLayout); | 355 | const shouldMaintainScrollAtEnd = !!(isWithinMaintainScrollAtEndThreshold && maintainScrollAtEnd && didContainersLayout); |
| ... | @@ -354,7 +379,7 @@ index b3c5a306b293f797a8b338adfca3060c0f6db22b..eb51ff0c375d7e5bd3473fca83995c7c | ... | @@ -354,7 +379,7 @@ index b3c5a306b293f797a8b338adfca3060c0f6db22b..eb51ff0c375d7e5bd3473fca83995c7c |
| 354 | } | 379 | } |
| 355 | if (!state.maintainingScrollAtEnd) { | 380 | if (!state.maintainingScrollAtEnd) { |
| 356 | const pendingState = maintainScrollAtEnd.animated ? "pending-animated" : "pending-instant"; | 381 | const pendingState = maintainScrollAtEnd.animated ? "pending-animated" : "pending-instant"; |
| 357 | @@ -1591,9 +1616,18 @@ function doMaintainScrollAtEnd(ctx) { | 382 | @@ -1591,9 +1625,18 @@ function doMaintainScrollAtEnd(ctx) { |
| 358 | y: 0 | 383 | y: 0 |
| 359 | }); | 384 | }); |
| 360 | } else { | 385 | } else { |
| ... | @@ -376,7 +401,7 @@ index b3c5a306b293f797a8b338adfca3060c0f6db22b..eb51ff0c375d7e5bd3473fca83995c7c | ... | @@ -376,7 +401,7 @@ index b3c5a306b293f797a8b338adfca3060c0f6db22b..eb51ff0c375d7e5bd3473fca83995c7c |
| 376 | } | 401 | } |
| 377 | setTimeout( | 402 | setTimeout( |
| 378 | () => { | 403 | () => { |
| 379 | @@ -1624,6 +1658,10 @@ function doMaintainScrollAtEnd(ctx) { | 404 | @@ -1624,6 +1667,10 @@ function doMaintainScrollAtEnd(ctx) { |
| 380 | function requestAdjust(ctx, positionDiff, dataChanged) { | 405 | function requestAdjust(ctx, positionDiff, dataChanged) { |
| 381 | const state = ctx.state; | 406 | const state = ctx.state; |
| 382 | if (Math.abs(positionDiff) > 0.1) { | 407 | if (Math.abs(positionDiff) > 0.1) { |
| ... | @@ -387,7 +412,7 @@ index b3c5a306b293f797a8b338adfca3060c0f6db22b..eb51ff0c375d7e5bd3473fca83995c7c | ... | @@ -387,7 +412,7 @@ index b3c5a306b293f797a8b338adfca3060c0f6db22b..eb51ff0c375d7e5bd3473fca83995c7c |
| 387 | const needsScrollWorkaround = Platform.OS === "android" && !IsNewArchitecture && dataChanged && state.scroll <= positionDiff; | 412 | const needsScrollWorkaround = Platform.OS === "android" && !IsNewArchitecture && dataChanged && state.scroll <= positionDiff; |
| 388 | const doit = () => { | 413 | const doit = () => { |
| 389 | if (needsScrollWorkaround) { | 414 | if (needsScrollWorkaround) { |
| 390 | @@ -1728,7 +1766,9 @@ function getPredictedNativeClamp(state, unresolvedAmount, totalSize) { | 415 | @@ -1728,7 +1775,9 @@ function getPredictedNativeClamp(state, unresolvedAmount, totalSize) { |
| 391 | if (Math.abs(unresolvedAmount) <= MVCP_POSITION_EPSILON) { | 416 | if (Math.abs(unresolvedAmount) <= MVCP_POSITION_EPSILON) { |
| 392 | return 0; | 417 | return 0; |
| 393 | } | 418 | } |
| ... | @@ -398,7 +423,7 @@ index b3c5a306b293f797a8b338adfca3060c0f6db22b..eb51ff0c375d7e5bd3473fca83995c7c | ... | @@ -398,7 +423,7 @@ index b3c5a306b293f797a8b338adfca3060c0f6db22b..eb51ff0c375d7e5bd3473fca83995c7c |
| 398 | const clampDelta = maxScroll - state.scroll; | 423 | const clampDelta = maxScroll - state.scroll; |
| 399 | if (unresolvedAmount < 0) { | 424 | if (unresolvedAmount < 0) { |
| 400 | return Math.max(unresolvedAmount, Math.min(0, clampDelta)); | 425 | return Math.max(unresolvedAmount, Math.min(0, clampDelta)); |
| 401 | @@ -1790,7 +1830,7 @@ function resolvePendingNativeMVCPAdjust(ctx, newScroll) { | 426 | @@ -1790,7 +1839,7 @@ function resolvePendingNativeMVCPAdjust(ctx, newScroll) { |
| 402 | settlePendingNativeMVCPAdjust(ctx, remainingAfterManual, nativeDelta); | 427 | settlePendingNativeMVCPAdjust(ctx, remainingAfterManual, nativeDelta); |
| 403 | return true; | 428 | return true; |
| 404 | } | 429 | } |
| ... | @@ -407,7 +432,7 @@ index b3c5a306b293f797a8b338adfca3060c0f6db22b..eb51ff0c375d7e5bd3473fca83995c7c | ... | @@ -407,7 +432,7 @@ index b3c5a306b293f797a8b338adfca3060c0f6db22b..eb51ff0c375d7e5bd3473fca83995c7c |
| 407 | const distanceToClamp = Math.abs(newScroll - expectedNativeClampScroll); | 432 | const distanceToClamp = Math.abs(newScroll - expectedNativeClampScroll); |
| 408 | const isAtExpectedNativeClamp = distanceToClamp <= NATIVE_END_CLAMP_EPSILON; | 433 | const isAtExpectedNativeClamp = distanceToClamp <= NATIVE_END_CLAMP_EPSILON; |
| 409 | if (isAtExpectedNativeClamp) { | 434 | if (isAtExpectedNativeClamp) { |
| 410 | @@ -1923,7 +1963,7 @@ function prepareMVCP(ctx, dataChanged) { | 435 | @@ -1923,7 +1972,7 @@ function prepareMVCP(ctx, dataChanged) { |
| 411 | if (diff > 0) { | 436 | if (diff > 0) { |
| 412 | diff = Math.max(0, totalSize - state.scroll - state.scrollLength); | 437 | diff = Math.max(0, totalSize - state.scroll - state.scrollLength); |
| 413 | } else { | 438 | } else { |
| ... | @@ -416,7 +441,7 @@ index b3c5a306b293f797a8b338adfca3060c0f6db22b..eb51ff0c375d7e5bd3473fca83995c7c | ... | @@ -416,7 +441,7 @@ index b3c5a306b293f797a8b338adfca3060c0f6db22b..eb51ff0c375d7e5bd3473fca83995c7c |
| 416 | state.scroll = maxScroll; | 441 | state.scroll = maxScroll; |
| 417 | state.scrollPending = maxScroll; | 442 | state.scrollPending = maxScroll; |
| 418 | diff = 0; | 443 | diff = 0; |
| 419 | @@ -2320,8 +2360,121 @@ function scrollToIndex(ctx, { | 444 | @@ -2320,8 +2369,121 @@ function scrollToIndex(ctx, { |
| 420 | } | 445 | } |
| 421 | | 446 | |
| 422 | // src/core/initialScroll.ts | 447 | // src/core/initialScroll.ts |
| ... | @@ -538,7 +563,7 @@ index b3c5a306b293f797a8b338adfca3060c0f6db22b..eb51ff0c375d7e5bd3473fca83995c7c | ... | @@ -538,7 +563,7 @@ index b3c5a306b293f797a8b338adfca3060c0f6db22b..eb51ff0c375d7e5bd3473fca83995c7c |
| 538 | const requestedIndex = target.index; | 563 | const requestedIndex = target.index; |
| 539 | const index = requestedIndex !== void 0 ? clampScrollIndex(requestedIndex, ctx.state.props.data.length) : void 0; | 564 | const index = requestedIndex !== void 0 ? clampScrollIndex(requestedIndex, ctx.state.props.data.length) : void 0; |
| 540 | const itemSize = getItemSizeAtIndex(ctx, index); | 565 | const itemSize = getItemSizeAtIndex(ctx, index); |
| 541 | @@ -2747,7 +2900,9 @@ function clearFinishedBootstrapInitialScrollTargetIfMovedAway(ctx) { | 566 | @@ -2747,7 +2909,9 @@ function clearFinishedBootstrapInitialScrollTargetIfMovedAway(ctx) { |
| 542 | return; | 567 | return; |
| 543 | } | 568 | } |
| 544 | if (didFinishedInitialScrollMoveAwayFromTarget(ctx, initialScroll)) { | 569 | if (didFinishedInitialScrollMoveAwayFromTarget(ctx, initialScroll)) { |
| ... | @@ -549,7 +574,7 @@ index b3c5a306b293f797a8b338adfca3060c0f6db22b..eb51ff0c375d7e5bd3473fca83995c7c | ... | @@ -549,7 +574,7 @@ index b3c5a306b293f797a8b338adfca3060c0f6db22b..eb51ff0c375d7e5bd3473fca83995c7c |
| 549 | if (!shouldKeepEndTargetAlive) { | 574 | if (!shouldKeepEndTargetAlive) { |
| 550 | if (shouldPreserveInitialScrollForFooterLayout(initialScroll)) { | 575 | if (shouldPreserveInitialScrollForFooterLayout(initialScroll)) { |
| 551 | clearPendingInitialScrollFooterLayout(ctx, { | 576 | clearPendingInitialScrollFooterLayout(ctx, { |
| 552 | @@ -4672,7 +4827,8 @@ function maybeUpdateAnchoredEndSpace(ctx) { | 577 | @@ -4672,7 +4836,8 @@ function maybeUpdateAnchoredEndSpace(ctx) { |
| 553 | contentBelowAnchor = Math.max(0, contentBelowAnchor - ctx.scrollAxisGap); | 578 | contentBelowAnchor = Math.max(0, contentBelowAnchor - ctx.scrollAxisGap); |
| 554 | contentBelowAnchor += (ctx.values.get("footerSize") || 0) + getStylePaddingEnd(state.props); | 579 | contentBelowAnchor += (ctx.values.get("footerSize") || 0) + getStylePaddingEnd(state.props); |
| 555 | isReady = !hasUnknownTailSize; | 580 | isReady = !hasUnknownTailSize; |
| ... | @@ -559,7 +584,7 @@ index b3c5a306b293f797a8b338adfca3060c0f6db22b..eb51ff0c375d7e5bd3473fca83995c7c | ... | @@ -559,7 +584,7 @@ index b3c5a306b293f797a8b338adfca3060c0f6db22b..eb51ff0c375d7e5bd3473fca83995c7c |
| 559 | } else if (anchorIndex >= 0) { | 584 | } else if (anchorIndex >= 0) { |
| 560 | isReady = false; | 585 | isReady = false; |
| 561 | } | 586 | } |
| 562 | @@ -4692,6 +4848,12 @@ function maybeUpdateAnchoredEndSpace(ctx) { | 587 | @@ -4692,6 +4857,12 @@ function maybeUpdateAnchoredEndSpace(ctx) { |
| 563 | updateScroll(ctx, state.scroll, true, { markHasScrolled: false }); | 588 | updateScroll(ctx, state.scroll, true, { markHasScrolled: false }); |
| 564 | } | 589 | } |
| 565 | (_b = anchoredEndSpace == null ? void 0 : anchoredEndSpace.onReady) == null ? void 0 : _b.call(anchoredEndSpace, { anchorIndex: nextAnchorIndex, anchorKey: nextAnchorKey, size: nextSize }); | 590 | (_b = anchoredEndSpace == null ? void 0 : anchoredEndSpace.onReady) == null ? void 0 : _b.call(anchoredEndSpace, { anchorIndex: nextAnchorIndex, anchorKey: nextAnchorKey, size: nextSize }); |
| ... | @@ -572,7 +597,7 @@ index b3c5a306b293f797a8b338adfca3060c0f6db22b..eb51ff0c375d7e5bd3473fca83995c7c | ... | @@ -572,7 +597,7 @@ index b3c5a306b293f797a8b338adfca3060c0f6db22b..eb51ff0c375d7e5bd3473fca83995c7c |
| 572 | } | 597 | } |
| 573 | return nextSize; | 598 | return nextSize; |
| 574 | } | 599 | } |
| 575 | @@ -5715,6 +5877,7 @@ var ContainersLayer = typedMemo(function ContainersLayer2({ | 600 | @@ -5715,6 +5886,7 @@ var ContainersLayer = typedMemo(function ContainersLayer2({ |
| 576 | horizontal | 601 | horizontal |
| 577 | }) { | 602 | }) { |
| 578 | const ctx = useStateContext(); | 603 | const ctx = useStateContext(); |
| ... | @@ -580,7 +605,7 @@ index b3c5a306b293f797a8b338adfca3060c0f6db22b..eb51ff0c375d7e5bd3473fca83995c7c | ... | @@ -580,7 +605,7 @@ index b3c5a306b293f797a8b338adfca3060c0f6db22b..eb51ff0c375d7e5bd3473fca83995c7c |
| 580 | const columnWrapperStyle = ctx.columnWrapperStyle; | 605 | const columnWrapperStyle = ctx.columnWrapperStyle; |
| 581 | const animSize = useValue$("totalSize"); | 606 | const animSize = useValue$("totalSize"); |
| 582 | const [readyToRender, numColumns, otherAxisSize = 0] = useArr$(["readyToRender", "numColumns", "otherAxisSize"]); | 607 | const [readyToRender, numColumns, otherAxisSize = 0] = useArr$(["readyToRender", "numColumns", "otherAxisSize"]); |
| 583 | @@ -5725,6 +5888,13 @@ var ContainersLayer = typedMemo(function ContainersLayer2({ | 608 | @@ -5725,6 +5897,13 @@ var ContainersLayer = typedMemo(function ContainersLayer2({ |
| 584 | opacity: isVisible ? 1 : 0, | 609 | opacity: isVisible ? 1 : 0, |
| 585 | width: animSize | 610 | width: animSize |
| 586 | } : { height: animSize, minWidth: otherAxisSize, opacity: isVisible ? 1 : 0 }; | 611 | } : { height: animSize, minWidth: otherAxisSize, opacity: isVisible ? 1 : 0 }; |
| ... | @@ -594,7 +619,7 @@ index b3c5a306b293f797a8b338adfca3060c0f6db22b..eb51ff0c375d7e5bd3473fca83995c7c | ... | @@ -594,7 +619,7 @@ index b3c5a306b293f797a8b338adfca3060c0f6db22b..eb51ff0c375d7e5bd3473fca83995c7c |
| 594 | if (columnWrapperStyle) { | 619 | if (columnWrapperStyle) { |
| 595 | const { columnGap, rowGap, gap } = columnWrapperStyle; | 620 | const { columnGap, rowGap, gap } = columnWrapperStyle; |
| 596 | const gapX = columnGap || gap || 0; | 621 | const gapX = columnGap || gap || 0; |
| 597 | @@ -5745,7 +5915,8 @@ var ContainersLayer = typedMemo(function ContainersLayer2({ | 622 | @@ -5745,7 +5924,8 @@ var ContainersLayer = typedMemo(function ContainersLayer2({ |
| 598 | } | 623 | } |
| 599 | } | 624 | } |
| 600 | } | 625 | } |
| ... | @@ -604,7 +629,7 @@ index b3c5a306b293f797a8b338adfca3060c0f6db22b..eb51ff0c375d7e5bd3473fca83995c7c | ... | @@ -604,7 +629,7 @@ index b3c5a306b293f797a8b338adfca3060c0f6db22b..eb51ff0c375d7e5bd3473fca83995c7c |
| 604 | }); | 629 | }); |
| 605 | var Containers = typedMemo(function Containers2({ | 630 | var Containers = typedMemo(function Containers2({ |
| 606 | freshDataTransitionEpoch, | 631 | freshDataTransitionEpoch, |
| 607 | @@ -5896,7 +6067,12 @@ var StyleSheet = ReactNative.StyleSheet; | 632 | @@ -5896,7 +6076,12 @@ var StyleSheet = ReactNative.StyleSheet; |
| 608 | | 633 | |
| 609 | // src/components/ListComponent.tsx | 634 | // src/components/ListComponent.tsx |
| 610 | var AlignItemsAtEndSpacer = typedMemo(function AlignItemsAtEndSpacer2({ horizontal }) { | 635 | var AlignItemsAtEndSpacer = typedMemo(function AlignItemsAtEndSpacer2({ horizontal }) { |
| ... | @@ -617,7 +642,7 @@ index b3c5a306b293f797a8b338adfca3060c0f6db22b..eb51ff0c375d7e5bd3473fca83995c7c | ... | @@ -617,7 +642,7 @@ index b3c5a306b293f797a8b338adfca3060c0f6db22b..eb51ff0c375d7e5bd3473fca83995c7c |
| 617 | if (alignItemsAtEndPadding <= 0) { | 642 | if (alignItemsAtEndPadding <= 0) { |
| 618 | return null; | 643 | return null; |
| 619 | } | 644 | } |
| 620 | @@ -5929,8 +6105,12 @@ var ListComponent = typedMemo(function ListComponent2({ | 645 | @@ -5929,8 +6114,12 @@ var ListComponent = typedMemo(function ListComponent2({ |
| 621 | refScrollView, | 646 | refScrollView, |
| 622 | renderScrollComponent, | 647 | renderScrollComponent, |
| 623 | onLayoutFooter, | 648 | onLayoutFooter, |
| ... | @@ -630,7 +655,7 @@ index b3c5a306b293f797a8b338adfca3060c0f6db22b..eb51ff0c375d7e5bd3473fca83995c7c | ... | @@ -630,7 +655,7 @@ index b3c5a306b293f797a8b338adfca3060c0f6db22b..eb51ff0c375d7e5bd3473fca83995c7c |
| 630 | scrollAdjustHandler, | 655 | scrollAdjustHandler, |
| 631 | snapToIndices, | 656 | snapToIndices, |
| 632 | stickyHeaderConfig, | 657 | stickyHeaderConfig, |
| 633 | @@ -6001,7 +6181,17 @@ var ListComponent = typedMemo(function ListComponent2({ | 658 | @@ -6001,7 +6190,17 @@ var ListComponent = typedMemo(function ListComponent2({ |
| 634 | SnapOrScroll, | 659 | SnapOrScroll, |
| 635 | { | 660 | { |
| 636 | ...rest, | 661 | ...rest, |
| ... | @@ -649,7 +674,16 @@ index b3c5a306b293f797a8b338adfca3060c0f6db22b..eb51ff0c375d7e5bd3473fca83995c7c | ... | @@ -649,7 +674,16 @@ index b3c5a306b293f797a8b338adfca3060c0f6db22b..eb51ff0c375d7e5bd3473fca83995c7c |
| 649 | contentContainerStyle: [ | 674 | contentContainerStyle: [ |
| 650 | horizontal ? { height: "100%" } : {}, | 675 | horizontal ? { height: "100%" } : {}, |
| 651 | contentContainerStyle, | 676 | contentContainerStyle, |
| 652 | @@ -7075,6 +7265,7 @@ var LegendListInner = typedForwardRef(function LegendListInner2(props, forwarded | 677 | @@ -6751,7 +6950,7 @@ function createImperativeHandle(ctx, scheduleImperativeScrollCommit) { |
| | 678 | endBuffered: state.endBuffered, |
| | 679 | getAverageItemSizes: () => getAverageItemSizes(state), |
| | 680 | indexByKey: (key) => state.indexByKey.get(key), |
| | 681 | - isAtEnd: peek$(ctx, "isAtEnd"), |
| | 682 | + isAtEnd: getIsAtEnd(ctx), |
| | 683 | isAtStart: peek$(ctx, "isAtStart"), |
| | 684 | isEndReached: state.isEndReached, |
| | 685 | isNearEnd: peek$(ctx, "isNearEnd"), |
| | 686 | @@ -7075,6 +7274,7 @@ var LegendListInner = typedForwardRef(function LegendListInner2(props, forwarded |
| 653 | dataVersion, | 687 | dataVersion, |
| 654 | drawDistance = 250, | 688 | drawDistance = 250, |
| 655 | contentInsetEndAdjustment, | 689 | contentInsetEndAdjustment, |
| ... | @@ -657,7 +691,7 @@ index b3c5a306b293f797a8b338adfca3060c0f6db22b..eb51ff0c375d7e5bd3473fca83995c7c | ... | @@ -657,7 +691,7 @@ index b3c5a306b293f797a8b338adfca3060c0f6db22b..eb51ff0c375d7e5bd3473fca83995c7c |
| 657 | estimatedItemSize = 100, | 691 | estimatedItemSize = 100, |
| 658 | estimatedListSize, | 692 | estimatedListSize, |
| 659 | extraData, | 693 | extraData, |
| 660 | @@ -7132,10 +7323,12 @@ var LegendListInner = typedForwardRef(function LegendListInner2(props, forwarded | 694 | @@ -7132,10 +7332,12 @@ var LegendListInner = typedForwardRef(function LegendListInner2(props, forwarded |
| 661 | const animatedPropsInternal = props.animatedPropsInternal; | 695 | const animatedPropsInternal = props.animatedPropsInternal; |
| 662 | const anchoredEndSpaceOwner = (_a3 = props.anchoredEndSpaceOwnerInternal) != null ? _a3 : "list"; | 696 | const anchoredEndSpaceOwner = (_a3 = props.anchoredEndSpaceOwnerInternal) != null ? _a3 : "list"; |
| 663 | const positionComponentInternal = props.positionComponentInternal; | 697 | const positionComponentInternal = props.positionComponentInternal; |
| ... | @@ -670,7 +704,7 @@ index b3c5a306b293f797a8b338adfca3060c0f6db22b..eb51ff0c375d7e5bd3473fca83995c7c | ... | @@ -670,7 +704,7 @@ index b3c5a306b293f797a8b338adfca3060c0f6db22b..eb51ff0c375d7e5bd3473fca83995c7c |
| 670 | stickyPositionComponentInternal: _stickyPositionComponentInternal, | 704 | stickyPositionComponentInternal: _stickyPositionComponentInternal, |
| 671 | ...restProps | 705 | ...restProps |
| 672 | } = rest; | 706 | } = rest; |
| 673 | @@ -7200,7 +7393,7 @@ var LegendListInner = typedForwardRef(function LegendListInner2(props, forwarded | 707 | @@ -7200,7 +7402,7 @@ var LegendListInner = typedForwardRef(function LegendListInner2(props, forwarded |
| 674 | const combinedRef = useCombinedRef(refScroller, refScrollView); | 708 | const combinedRef = useCombinedRef(refScroller, refScrollView); |
| 675 | const keyExtractor = keyExtractorProp != null ? keyExtractorProp : ((_item, index) => index.toString()); | 709 | const keyExtractor = keyExtractorProp != null ? keyExtractorProp : ((_item, index) => index.toString()); |
| 676 | const stickyHeaderIndices = stickyHeaderIndicesProp; | 710 | const stickyHeaderIndices = stickyHeaderIndicesProp; |
| ... | @@ -679,7 +713,7 @@ index b3c5a306b293f797a8b338adfca3060c0f6db22b..eb51ff0c375d7e5bd3473fca83995c7c | ... | @@ -679,7 +713,7 @@ index b3c5a306b293f797a8b338adfca3060c0f6db22b..eb51ff0c375d7e5bd3473fca83995c7c |
| 679 | const previousContentInsetEndAdjustmentRef = React2.useRef(contentInsetEndAdjustmentResolved); | 713 | const previousContentInsetEndAdjustmentRef = React2.useRef(contentInsetEndAdjustmentResolved); |
| 680 | const alwaysRenderIndices = React2.useMemo(() => { | 714 | const alwaysRenderIndices = React2.useMemo(() => { |
| 681 | const indices = getAlwaysRenderIndices(alwaysRender, dataProp, keyExtractor, anchoredEndSpace == null ? void 0 : anchoredEndSpace.anchorIndex); | 715 | const indices = getAlwaysRenderIndices(alwaysRender, dataProp, keyExtractor, anchoredEndSpace == null ? void 0 : anchoredEndSpace.anchorIndex); |
| 682 | @@ -7341,6 +7534,7 @@ var LegendListInner = typedForwardRef(function LegendListInner2(props, forwarded | 716 | @@ -7341,6 +7543,7 @@ var LegendListInner = typedForwardRef(function LegendListInner2(props, forwarded |
| 683 | contentContainerAlignItems: contentContainerStyle.alignItems, | 717 | contentContainerAlignItems: contentContainerStyle.alignItems, |
| 684 | contentInset, | 718 | contentInset, |
| 685 | contentInsetEndAdjustment: contentInsetEndAdjustmentResolved, | 719 | contentInsetEndAdjustment: contentInsetEndAdjustmentResolved, |
| ... | @@ -687,7 +721,7 @@ index b3c5a306b293f797a8b338adfca3060c0f6db22b..eb51ff0c375d7e5bd3473fca83995c7c | ... | @@ -687,7 +721,7 @@ index b3c5a306b293f797a8b338adfca3060c0f6db22b..eb51ff0c375d7e5bd3473fca83995c7c |
| 687 | data: dataProp, | 721 | data: dataProp, |
| 688 | dataKey, | 722 | dataKey, |
| 689 | dataVersion, | 723 | dataVersion, |
| 690 | @@ -7372,6 +7566,7 @@ var LegendListInner = typedForwardRef(function LegendListInner2(props, forwarded | 724 | @@ -7372,6 +7575,7 @@ var LegendListInner = typedForwardRef(function LegendListInner2(props, forwarded |
| 691 | renderItem, | 725 | renderItem, |
| 692 | rtl, | 726 | rtl, |
| 693 | snapToIndices, | 727 | snapToIndices, |
| ... | @@ -695,7 +729,7 @@ index b3c5a306b293f797a8b338adfca3060c0f6db22b..eb51ff0c375d7e5bd3473fca83995c7c | ... | @@ -695,7 +729,7 @@ index b3c5a306b293f797a8b338adfca3060c0f6db22b..eb51ff0c375d7e5bd3473fca83995c7c |
| 695 | stickyHeaderIndicesArr: stickyHeaderIndices != null ? stickyHeaderIndices : [], | 729 | stickyHeaderIndicesArr: stickyHeaderIndices != null ? stickyHeaderIndices : [], |
| 696 | stickyHeaderIndicesSet: React2.useMemo(() => new Set(stickyHeaderIndices != null ? stickyHeaderIndices : []), [stickyHeaderIndices == null ? void 0 : stickyHeaderIndices.join(",")]), | 730 | stickyHeaderIndicesSet: React2.useMemo(() => new Set(stickyHeaderIndices != null ? stickyHeaderIndices : []), [stickyHeaderIndices == null ? void 0 : stickyHeaderIndices.join(",")]), |
| 697 | stickyPositionComponentInternal, | 731 | stickyPositionComponentInternal, |
| 698 | @@ -7423,6 +7618,13 @@ var LegendListInner = typedForwardRef(function LegendListInner2(props, forwarded | 732 | @@ -7423,6 +7627,13 @@ var LegendListInner = typedForwardRef(function LegendListInner2(props, forwarded |
| 699 | return void 0; | 733 | return void 0; |
| 700 | } | 734 | } |
| 701 | const resolvedOffset = (_a4 = initialScroll.contentOffset) != null ? _a4 : resolveInitialScrollOffset(ctx, initialScroll); | 735 | const resolvedOffset = (_a4 = initialScroll.contentOffset) != null ? _a4 : resolveInitialScrollOffset(ctx, initialScroll); |
| ... | @@ -709,7 +743,7 @@ index b3c5a306b293f797a8b338adfca3060c0f6db22b..eb51ff0c375d7e5bd3473fca83995c7c | ... | @@ -709,7 +743,7 @@ index b3c5a306b293f797a8b338adfca3060c0f6db22b..eb51ff0c375d7e5bd3473fca83995c7c |
| 709 | return usesBootstrapInitialScroll && ((_b2 = state.initialScrollSession) == null ? void 0 : _b2.kind) === "bootstrap" && Platform.OS === "web" ? void 0 : resolvedOffset; | 743 | return usesBootstrapInitialScroll && ((_b2 = state.initialScrollSession) == null ? void 0 : _b2.kind) === "bootstrap" && Platform.OS === "web" ? void 0 : resolvedOffset; |
| 710 | }, [usesBootstrapInitialScroll]); | 744 | }, [usesBootstrapInitialScroll]); |
| 711 | React2.useLayoutEffect(() => { | 745 | React2.useLayoutEffect(() => { |
| 712 | @@ -7547,6 +7749,7 @@ var LegendListInner = typedForwardRef(function LegendListInner2(props, forwarded | 746 | @@ -7547,6 +7758,7 @@ var LegendListInner = typedForwardRef(function LegendListInner2(props, forwarded |
| 713 | [ | 747 | [ |
| 714 | dataKey, | 748 | dataKey, |
| 715 | dataVersion, | 749 | dataVersion, |
| ... | @@ -717,7 +751,7 @@ index b3c5a306b293f797a8b338adfca3060c0f6db22b..eb51ff0c375d7e5bd3473fca83995c7c | ... | @@ -717,7 +751,7 @@ index b3c5a306b293f797a8b338adfca3060c0f6db22b..eb51ff0c375d7e5bd3473fca83995c7c |
| 717 | memoizedLastItemKeys.join(","), | 751 | memoizedLastItemKeys.join(","), |
| 718 | numColumnsProp, | 752 | numColumnsProp, |
| 719 | nextScrollAxisGap, | 753 | nextScrollAxisGap, |
| 720 | @@ -7643,6 +7846,7 @@ var LegendListInner = typedForwardRef(function LegendListInner2(props, forwarded | 754 | @@ -7643,6 +7855,7 @@ var LegendListInner = typedForwardRef(function LegendListInner2(props, forwarded |
| 721 | () => ({ | 755 | () => ({ |
| 722 | getRenderedItem: (key) => getRenderedItem(ctx, key), | 756 | getRenderedItem: (key) => getRenderedItem(ctx, key), |
| 723 | onMomentumScrollEnd: (event) => { | 757 | onMomentumScrollEnd: (event) => { |
| ... | @@ -725,7 +759,7 @@ index b3c5a306b293f797a8b338adfca3060c0f6db22b..eb51ff0c375d7e5bd3473fca83995c7c | ... | @@ -725,7 +759,7 @@ index b3c5a306b293f797a8b338adfca3060c0f6db22b..eb51ff0c375d7e5bd3473fca83995c7c |
| 725 | checkFinishedScrollFallback(ctx); | 759 | checkFinishedScrollFallback(ctx); |
| 726 | if (state.props.onMomentumScrollEnd) { | 760 | if (state.props.onMomentumScrollEnd) { |
| 727 | state.props.onMomentumScrollEnd(event); | 761 | state.props.onMomentumScrollEnd(event); |
| 728 | @@ -7651,6 +7855,8 @@ var LegendListInner = typedForwardRef(function LegendListInner2(props, forwarded | 762 | @@ -7651,6 +7864,8 @@ var LegendListInner = typedForwardRef(function LegendListInner2(props, forwarded |
| 729 | onScroll: (event) => onScroll(ctx, event), | 763 | onScroll: (event) => onScroll(ctx, event), |
| 730 | onScrollBeginDrag: (event) => { | 764 | onScrollBeginDrag: (event) => { |
| 731 | var _a4, _b2; | 765 | var _a4, _b2; |
| ... | @@ -734,7 +768,7 @@ index b3c5a306b293f797a8b338adfca3060c0f6db22b..eb51ff0c375d7e5bd3473fca83995c7c | ... | @@ -734,7 +768,7 @@ index b3c5a306b293f797a8b338adfca3060c0f6db22b..eb51ff0c375d7e5bd3473fca83995c7c |
| 734 | prepareReachedEdgeForNextUserScroll(ctx); | 768 | prepareReachedEdgeForNextUserScroll(ctx); |
| 735 | (_b2 = (_a4 = state.props).onScrollBeginDrag) == null ? void 0 : _b2.call(_a4, event); | 769 | (_b2 = (_a4 = state.props).onScrollBeginDrag) == null ? void 0 : _b2.call(_a4, event); |
| 736 | }, | 770 | }, |
| 737 | @@ -7676,11 +7882,18 @@ var LegendListInner = typedForwardRef(function LegendListInner2(props, forwarded | 771 | @@ -7676,11 +7891,18 @@ var LegendListInner = typedForwardRef(function LegendListInner2(props, forwarded |
| 738 | ListFooterComponent, | 772 | ListFooterComponent, |
| 739 | ListFooterComponentStyle, | 773 | ListFooterComponentStyle, |
| 740 | ListHeaderComponent, | 774 | ListHeaderComponent, |
| ... | @@ -754,10 +788,35 @@ index b3c5a306b293f797a8b338adfca3060c0f6db22b..eb51ff0c375d7e5bd3473fca83995c7c | ... | @@ -754,10 +788,35 @@ index b3c5a306b293f797a8b338adfca3060c0f6db22b..eb51ff0c375d7e5bd3473fca83995c7c |
| 754 | recycleItems, | 788 | recycleItems, |
| 755 | refreshControl: refreshControlElement ? stylePaddingTopState > 0 ? React2__namespace.cloneElement(refreshControlElement, { | 789 | refreshControl: refreshControlElement ? stylePaddingTopState > 0 ? React2__namespace.cloneElement(refreshControlElement, { |
| 756 | diff --git a/react-native.mjs b/react-native.mjs | 790 | diff --git a/react-native.mjs b/react-native.mjs |
| 757 | index 40e87cda8c9bc79a889e5542f29af429a24b24d4..700515b52c27a4ccd5343176121e7318d57e29dc 100644 | 791 | index 40e87cda8c9bc79a889e5542f29af429a24b24d4..90e0d1a9dfd07d0212aae308f547b9ff7e3ad022 100644 |
| 758 | --- a/react-native.mjs | 792 | --- a/react-native.mjs |
| 759 | +++ b/react-native.mjs | 793 | +++ b/react-native.mjs |
| 760 | @@ -933,7 +933,7 @@ function setInitialRenderState(ctx, { | 794 | @@ -696,6 +696,15 @@ function hasActiveInitialScroll(state) { |
| | 795 | return !!(state == null ? void 0 : state.initialScroll) && !state.didFinishInitialScroll; |
| | 796 | } |
| | 797 | |
| | 798 | +// Size-only changes may not emit a scroll event to refresh the edge signal. |
| | 799 | +function getIsAtEnd(ctx, contentSize = getContentSize(ctx)) { |
| | 800 | + const { queuedInitialLayout, scroll, scrollLength } = ctx.state; |
| | 801 | + if (!(contentSize > 0 && queuedInitialLayout)) { |
| | 802 | + return peek$(ctx, "isAtEnd"); |
| | 803 | + } |
| | 804 | + return contentSize < scrollLength || contentSize - scroll - scrollLength - getContentInsetEnd(ctx) <= EDGE_POSITION_EPSILON; |
| | 805 | +} |
| | 806 | + |
| | 807 | // src/utils/checkAtBottom.ts |
| | 808 | function checkAtBottom(ctx, allowedEdge, allowGateCreatedInCurrentCheck) { |
| | 809 | var _a3; |
| | 810 | @@ -716,7 +725,7 @@ function checkAtBottom(ctx, allowedEdge, allowGateCreatedInCurrentCheck) { |
| | 811 | const insetEnd = getContentInsetEnd(ctx); |
| | 812 | const distanceFromEnd = contentSize - scroll - scrollLength - insetEnd; |
| | 813 | const isContentLess = contentSize < scrollLength; |
| | 814 | - set$(ctx, "isAtEnd", isContentLess || distanceFromEnd <= EDGE_POSITION_EPSILON); |
| | 815 | + set$(ctx, "isAtEnd", getIsAtEnd(ctx, contentSize)); |
| | 816 | set$(ctx, "isNearEnd", isContentLess || distanceFromEnd <= onEndReachedThreshold * scrollLength); |
| | 817 | set$( |
| | 818 | ctx, |
| | 819 | @@ -933,7 +942,7 @@ function setInitialRenderState(ctx, { |
| 761 | if (didInitialScroll) { | 820 | if (didInitialScroll) { |
| 762 | state.didFinishInitialScroll = true; | 821 | state.didFinishInitialScroll = true; |
| 763 | } | 822 | } |
| ... | @@ -766,7 +825,7 @@ index 40e87cda8c9bc79a889e5542f29af429a24b24d4..700515b52c27a4ccd5343176121e7318 | ... | @@ -766,7 +825,7 @@ index 40e87cda8c9bc79a889e5542f29af429a24b24d4..700515b52c27a4ccd5343176121e7318 |
| 766 | if (isReadyToRender && !peek$(ctx, "readyToRender")) { | 825 | if (isReadyToRender && !peek$(ctx, "readyToRender")) { |
| 767 | set$(ctx, "readyToRender", true); | 826 | set$(ctx, "readyToRender", true); |
| 768 | setAdaptiveRender(ctx, "normal", "ready"); | 827 | setAdaptiveRender(ctx, "normal", "ready"); |
| 769 | @@ -1069,7 +1069,7 @@ function getRawContentLength(ctx) { | 828 | @@ -1069,7 +1078,7 @@ function getRawContentLength(ctx) { |
| 770 | function getAlignItemsAtEndPadding(ctx) { | 829 | function getAlignItemsAtEndPadding(ctx) { |
| 771 | const { state } = ctx; | 830 | const { state } = ctx; |
| 772 | const shouldPad = !!state.props.alignItemsAtEndPaddingEnabled && !state.props.horizontal && state.props.data.length > 0 && state.scrollLength > 0; | 831 | const shouldPad = !!state.props.alignItemsAtEndPaddingEnabled && !state.props.horizontal && state.props.data.length > 0 && state.scrollLength > 0; |
| ... | @@ -775,7 +834,7 @@ index 40e87cda8c9bc79a889e5542f29af429a24b24d4..700515b52c27a4ccd5343176121e7318 | ... | @@ -775,7 +834,7 @@ index 40e87cda8c9bc79a889e5542f29af429a24b24d4..700515b52c27a4ccd5343176121e7318 |
| 775 | } | 834 | } |
| 776 | function updateContentMetricsState(ctx) { | 835 | function updateContentMetricsState(ctx) { |
| 777 | const previousPadding = peek$(ctx, "alignItemsAtEndPadding") || 0; | 836 | const previousPadding = peek$(ctx, "alignItemsAtEndPadding") || 0; |
| 778 | @@ -1094,6 +1094,10 @@ function addTotalSize(ctx, key, add, notifyTotalSize = true) { | 837 | @@ -1094,6 +1103,10 @@ function addTotalSize(ctx, key, add, notifyTotalSize = true) { |
| 779 | totalSize += add; | 838 | totalSize += add; |
| 780 | } | 839 | } |
| 781 | if (prevTotalSize !== totalSize) { | 840 | if (prevTotalSize !== totalSize) { |
| ... | @@ -786,7 +845,7 @@ index 40e87cda8c9bc79a889e5542f29af429a24b24d4..700515b52c27a4ccd5343176121e7318 | ... | @@ -786,7 +845,7 @@ index 40e87cda8c9bc79a889e5542f29af429a24b24d4..700515b52c27a4ccd5343176121e7318 |
| 786 | if (!IsNewArchitecture && state.initialScroll && totalSize < prevTotalSize) { | 845 | if (!IsNewArchitecture && state.initialScroll && totalSize < prevTotalSize) { |
| 787 | state.pendingTotalSize = totalSize; | 846 | state.pendingTotalSize = totalSize; |
| 788 | } else { | 847 | } else { |
| 789 | @@ -1283,18 +1287,23 @@ function calculateOffsetWithOffsetPosition(ctx, offsetParam, params) { | 848 | @@ -1283,18 +1296,23 @@ function calculateOffsetWithOffsetPosition(ctx, offsetParam, params) { |
| 790 | } | 849 | } |
| 791 | | 850 | |
| 792 | // src/core/clampScrollOffset.ts | 851 | // src/core/clampScrollOffset.ts |
| ... | @@ -812,7 +871,7 @@ index 40e87cda8c9bc79a889e5542f29af429a24b24d4..700515b52c27a4ccd5343176121e7318 | ... | @@ -812,7 +871,7 @@ index 40e87cda8c9bc79a889e5542f29af429a24b24d4..700515b52c27a4ccd5343176121e7318 |
| 812 | return clampedOffset; | 871 | return clampedOffset; |
| 813 | } | 872 | } |
| 814 | | 873 | |
| 815 | @@ -1430,10 +1439,10 @@ function checkFinishedScrollFrame(ctx) { | 874 | @@ -1430,10 +1448,10 @@ function checkFinishedScrollFrame(ctx) { |
| 816 | finishScrollTo(ctx); | 875 | finishScrollTo(ctx); |
| 817 | } | 876 | } |
| 818 | } | 877 | } |
| ... | @@ -825,7 +884,7 @@ index 40e87cda8c9bc79a889e5542f29af429a24b24d4..700515b52c27a4ccd5343176121e7318 | ... | @@ -825,7 +884,7 @@ index 40e87cda8c9bc79a889e5542f29af429a24b24d4..700515b52c27a4ccd5343176121e7318 |
| 825 | x: ctx.state.props.horizontal ? offset : 0, | 884 | x: ctx.state.props.horizontal ? offset : 0, |
| 826 | y: ctx.state.props.horizontal ? 0 : offset | 885 | y: ctx.state.props.horizontal ? 0 : offset |
| 827 | }); | 886 | }); |
| 828 | @@ -1482,7 +1491,10 @@ function checkFinishedScrollFallback(ctx) { | 887 | @@ -1482,7 +1500,10 @@ function checkFinishedScrollFallback(ctx) { |
| 829 | ); | 888 | ); |
| 830 | scheduleFallbackCheck(SILENT_INITIAL_SCROLL_RETRY_DELAY_MS); | 889 | scheduleFallbackCheck(SILENT_INITIAL_SCROLL_RETRY_DELAY_MS); |
| 831 | } else if (shouldRetryUnalignedEndScroll) { | 890 | } else if (shouldRetryUnalignedEndScroll) { |
| ... | @@ -837,7 +896,7 @@ index 40e87cda8c9bc79a889e5542f29af429a24b24d4..700515b52c27a4ccd5343176121e7318 | ... | @@ -837,7 +896,7 @@ index 40e87cda8c9bc79a889e5542f29af429a24b24d4..700515b52c27a4ccd5343176121e7318 |
| 837 | scheduleFallbackCheck(100); | 896 | scheduleFallbackCheck(100); |
| 838 | } else if (shouldFinishZeroTarget || shouldFinishAfterObservedScroll || canFinishInitialScrollWithoutNativeProgress || canFinishAfterSilentNativeDispatch || numChecks > maxChecks) { | 897 | } else if (shouldFinishZeroTarget || shouldFinishAfterObservedScroll || canFinishInitialScrollWithoutNativeProgress || canFinishAfterSilentNativeDispatch || numChecks > maxChecks) { |
| 839 | finishScrollTo(ctx); | 898 | finishScrollTo(ctx); |
| 840 | @@ -1539,15 +1551,28 @@ function doMaintainScrollAtEnd(ctx) { | 899 | @@ -1539,15 +1560,28 @@ function doMaintainScrollAtEnd(ctx) { |
| 841 | } = state; | 900 | } = state; |
| 842 | const isWithinMaintainScrollAtEndThreshold = peek$(ctx, "isWithinMaintainScrollAtEndThreshold"); | 901 | const isWithinMaintainScrollAtEndThreshold = peek$(ctx, "isWithinMaintainScrollAtEndThreshold"); |
| 843 | const shouldMaintainScrollAtEnd = !!(isWithinMaintainScrollAtEndThreshold && maintainScrollAtEnd && didContainersLayout); | 902 | const shouldMaintainScrollAtEnd = !!(isWithinMaintainScrollAtEndThreshold && maintainScrollAtEnd && didContainersLayout); |
| ... | @@ -867,7 +926,7 @@ index 40e87cda8c9bc79a889e5542f29af429a24b24d4..700515b52c27a4ccd5343176121e7318 | ... | @@ -867,7 +926,7 @@ index 40e87cda8c9bc79a889e5542f29af429a24b24d4..700515b52c27a4ccd5343176121e7318 |
| 867 | } | 926 | } |
| 868 | if (!state.maintainingScrollAtEnd) { | 927 | if (!state.maintainingScrollAtEnd) { |
| 869 | const pendingState = maintainScrollAtEnd.animated ? "pending-animated" : "pending-instant"; | 928 | const pendingState = maintainScrollAtEnd.animated ? "pending-animated" : "pending-instant"; |
| 870 | @@ -1570,9 +1595,18 @@ function doMaintainScrollAtEnd(ctx) { | 929 | @@ -1570,9 +1604,18 @@ function doMaintainScrollAtEnd(ctx) { |
| 871 | y: 0 | 930 | y: 0 |
| 872 | }); | 931 | }); |
| 873 | } else { | 932 | } else { |
| ... | @@ -889,7 +948,7 @@ index 40e87cda8c9bc79a889e5542f29af429a24b24d4..700515b52c27a4ccd5343176121e7318 | ... | @@ -889,7 +948,7 @@ index 40e87cda8c9bc79a889e5542f29af429a24b24d4..700515b52c27a4ccd5343176121e7318 |
| 889 | } | 948 | } |
| 890 | setTimeout( | 949 | setTimeout( |
| 891 | () => { | 950 | () => { |
| 892 | @@ -1603,6 +1637,10 @@ function doMaintainScrollAtEnd(ctx) { | 951 | @@ -1603,6 +1646,10 @@ function doMaintainScrollAtEnd(ctx) { |
| 893 | function requestAdjust(ctx, positionDiff, dataChanged) { | 952 | function requestAdjust(ctx, positionDiff, dataChanged) { |
| 894 | const state = ctx.state; | 953 | const state = ctx.state; |
| 895 | if (Math.abs(positionDiff) > 0.1) { | 954 | if (Math.abs(positionDiff) > 0.1) { |
| ... | @@ -900,7 +959,7 @@ index 40e87cda8c9bc79a889e5542f29af429a24b24d4..700515b52c27a4ccd5343176121e7318 | ... | @@ -900,7 +959,7 @@ index 40e87cda8c9bc79a889e5542f29af429a24b24d4..700515b52c27a4ccd5343176121e7318 |
| 900 | const needsScrollWorkaround = Platform.OS === "android" && !IsNewArchitecture && dataChanged && state.scroll <= positionDiff; | 959 | const needsScrollWorkaround = Platform.OS === "android" && !IsNewArchitecture && dataChanged && state.scroll <= positionDiff; |
| 901 | const doit = () => { | 960 | const doit = () => { |
| 902 | if (needsScrollWorkaround) { | 961 | if (needsScrollWorkaround) { |
| 903 | @@ -1707,7 +1745,9 @@ function getPredictedNativeClamp(state, unresolvedAmount, totalSize) { | 962 | @@ -1707,7 +1754,9 @@ function getPredictedNativeClamp(state, unresolvedAmount, totalSize) { |
| 904 | if (Math.abs(unresolvedAmount) <= MVCP_POSITION_EPSILON) { | 963 | if (Math.abs(unresolvedAmount) <= MVCP_POSITION_EPSILON) { |
| 905 | return 0; | 964 | return 0; |
| 906 | } | 965 | } |
| ... | @@ -911,7 +970,7 @@ index 40e87cda8c9bc79a889e5542f29af429a24b24d4..700515b52c27a4ccd5343176121e7318 | ... | @@ -911,7 +970,7 @@ index 40e87cda8c9bc79a889e5542f29af429a24b24d4..700515b52c27a4ccd5343176121e7318 |
| 911 | const clampDelta = maxScroll - state.scroll; | 970 | const clampDelta = maxScroll - state.scroll; |
| 912 | if (unresolvedAmount < 0) { | 971 | if (unresolvedAmount < 0) { |
| 913 | return Math.max(unresolvedAmount, Math.min(0, clampDelta)); | 972 | return Math.max(unresolvedAmount, Math.min(0, clampDelta)); |
| 914 | @@ -1769,7 +1809,7 @@ function resolvePendingNativeMVCPAdjust(ctx, newScroll) { | 973 | @@ -1769,7 +1818,7 @@ function resolvePendingNativeMVCPAdjust(ctx, newScroll) { |
| 915 | settlePendingNativeMVCPAdjust(ctx, remainingAfterManual, nativeDelta); | 974 | settlePendingNativeMVCPAdjust(ctx, remainingAfterManual, nativeDelta); |
| 916 | return true; | 975 | return true; |
| 917 | } | 976 | } |
| ... | @@ -920,7 +979,7 @@ index 40e87cda8c9bc79a889e5542f29af429a24b24d4..700515b52c27a4ccd5343176121e7318 | ... | @@ -920,7 +979,7 @@ index 40e87cda8c9bc79a889e5542f29af429a24b24d4..700515b52c27a4ccd5343176121e7318 |
| 920 | const distanceToClamp = Math.abs(newScroll - expectedNativeClampScroll); | 979 | const distanceToClamp = Math.abs(newScroll - expectedNativeClampScroll); |
| 921 | const isAtExpectedNativeClamp = distanceToClamp <= NATIVE_END_CLAMP_EPSILON; | 980 | const isAtExpectedNativeClamp = distanceToClamp <= NATIVE_END_CLAMP_EPSILON; |
| 922 | if (isAtExpectedNativeClamp) { | 981 | if (isAtExpectedNativeClamp) { |
| 923 | @@ -1902,7 +1942,7 @@ function prepareMVCP(ctx, dataChanged) { | 982 | @@ -1902,7 +1951,7 @@ function prepareMVCP(ctx, dataChanged) { |
| 924 | if (diff > 0) { | 983 | if (diff > 0) { |
| 925 | diff = Math.max(0, totalSize - state.scroll - state.scrollLength); | 984 | diff = Math.max(0, totalSize - state.scroll - state.scrollLength); |
| 926 | } else { | 985 | } else { |
| ... | @@ -929,7 +988,7 @@ index 40e87cda8c9bc79a889e5542f29af429a24b24d4..700515b52c27a4ccd5343176121e7318 | ... | @@ -929,7 +988,7 @@ index 40e87cda8c9bc79a889e5542f29af429a24b24d4..700515b52c27a4ccd5343176121e7318 |
| 929 | state.scroll = maxScroll; | 988 | state.scroll = maxScroll; |
| 930 | state.scrollPending = maxScroll; | 989 | state.scrollPending = maxScroll; |
| 931 | diff = 0; | 990 | diff = 0; |
| 932 | @@ -2299,8 +2339,121 @@ function scrollToIndex(ctx, { | 991 | @@ -2299,8 +2348,121 @@ function scrollToIndex(ctx, { |
| 933 | } | 992 | } |
| 934 | | 993 | |
| 935 | // src/core/initialScroll.ts | 994 | // src/core/initialScroll.ts |
| ... | @@ -1051,7 +1110,7 @@ index 40e87cda8c9bc79a889e5542f29af429a24b24d4..700515b52c27a4ccd5343176121e7318 | ... | @@ -1051,7 +1110,7 @@ index 40e87cda8c9bc79a889e5542f29af429a24b24d4..700515b52c27a4ccd5343176121e7318 |
| 1051 | const requestedIndex = target.index; | 1110 | const requestedIndex = target.index; |
| 1052 | const index = requestedIndex !== void 0 ? clampScrollIndex(requestedIndex, ctx.state.props.data.length) : void 0; | 1111 | const index = requestedIndex !== void 0 ? clampScrollIndex(requestedIndex, ctx.state.props.data.length) : void 0; |
| 1053 | const itemSize = getItemSizeAtIndex(ctx, index); | 1112 | const itemSize = getItemSizeAtIndex(ctx, index); |
| 1054 | @@ -2726,7 +2879,9 @@ function clearFinishedBootstrapInitialScrollTargetIfMovedAway(ctx) { | 1113 | @@ -2726,7 +2888,9 @@ function clearFinishedBootstrapInitialScrollTargetIfMovedAway(ctx) { |
| 1055 | return; | 1114 | return; |
| 1056 | } | 1115 | } |
| 1057 | if (didFinishedInitialScrollMoveAwayFromTarget(ctx, initialScroll)) { | 1116 | if (didFinishedInitialScrollMoveAwayFromTarget(ctx, initialScroll)) { |
| ... | @@ -1062,7 +1121,7 @@ index 40e87cda8c9bc79a889e5542f29af429a24b24d4..700515b52c27a4ccd5343176121e7318 | ... | @@ -1062,7 +1121,7 @@ index 40e87cda8c9bc79a889e5542f29af429a24b24d4..700515b52c27a4ccd5343176121e7318 |
| 1062 | if (!shouldKeepEndTargetAlive) { | 1121 | if (!shouldKeepEndTargetAlive) { |
| 1063 | if (shouldPreserveInitialScrollForFooterLayout(initialScroll)) { | 1122 | if (shouldPreserveInitialScrollForFooterLayout(initialScroll)) { |
| 1064 | clearPendingInitialScrollFooterLayout(ctx, { | 1123 | clearPendingInitialScrollFooterLayout(ctx, { |
| 1065 | @@ -4651,7 +4806,8 @@ function maybeUpdateAnchoredEndSpace(ctx) { | 1124 | @@ -4651,7 +4815,8 @@ function maybeUpdateAnchoredEndSpace(ctx) { |
| 1066 | contentBelowAnchor = Math.max(0, contentBelowAnchor - ctx.scrollAxisGap); | 1125 | contentBelowAnchor = Math.max(0, contentBelowAnchor - ctx.scrollAxisGap); |
| 1067 | contentBelowAnchor += (ctx.values.get("footerSize") || 0) + getStylePaddingEnd(state.props); | 1126 | contentBelowAnchor += (ctx.values.get("footerSize") || 0) + getStylePaddingEnd(state.props); |
| 1068 | isReady = !hasUnknownTailSize; | 1127 | isReady = !hasUnknownTailSize; |
| ... | @@ -1072,7 +1131,7 @@ index 40e87cda8c9bc79a889e5542f29af429a24b24d4..700515b52c27a4ccd5343176121e7318 | ... | @@ -1072,7 +1131,7 @@ index 40e87cda8c9bc79a889e5542f29af429a24b24d4..700515b52c27a4ccd5343176121e7318 |
| 1072 | } else if (anchorIndex >= 0) { | 1131 | } else if (anchorIndex >= 0) { |
| 1073 | isReady = false; | 1132 | isReady = false; |
| 1074 | } | 1133 | } |
| 1075 | @@ -4671,6 +4827,12 @@ function maybeUpdateAnchoredEndSpace(ctx) { | 1134 | @@ -4671,6 +4836,12 @@ function maybeUpdateAnchoredEndSpace(ctx) { |
| 1076 | updateScroll(ctx, state.scroll, true, { markHasScrolled: false }); | 1135 | updateScroll(ctx, state.scroll, true, { markHasScrolled: false }); |
| 1077 | } | 1136 | } |
| 1078 | (_b = anchoredEndSpace == null ? void 0 : anchoredEndSpace.onReady) == null ? void 0 : _b.call(anchoredEndSpace, { anchorIndex: nextAnchorIndex, anchorKey: nextAnchorKey, size: nextSize }); | 1137 | (_b = anchoredEndSpace == null ? void 0 : anchoredEndSpace.onReady) == null ? void 0 : _b.call(anchoredEndSpace, { anchorIndex: nextAnchorIndex, anchorKey: nextAnchorKey, size: nextSize }); |
| ... | @@ -1085,7 +1144,7 @@ index 40e87cda8c9bc79a889e5542f29af429a24b24d4..700515b52c27a4ccd5343176121e7318 | ... | @@ -1085,7 +1144,7 @@ index 40e87cda8c9bc79a889e5542f29af429a24b24d4..700515b52c27a4ccd5343176121e7318 |
| 1085 | } | 1144 | } |
| 1086 | return nextSize; | 1145 | return nextSize; |
| 1087 | } | 1146 | } |
| 1088 | @@ -5694,6 +5856,7 @@ var ContainersLayer = typedMemo(function ContainersLayer2({ | 1147 | @@ -5694,6 +5865,7 @@ var ContainersLayer = typedMemo(function ContainersLayer2({ |
| 1089 | horizontal | 1148 | horizontal |
| 1090 | }) { | 1149 | }) { |
| 1091 | const ctx = useStateContext(); | 1150 | const ctx = useStateContext(); |
| ... | @@ -1093,7 +1152,7 @@ index 40e87cda8c9bc79a889e5542f29af429a24b24d4..700515b52c27a4ccd5343176121e7318 | ... | @@ -1093,7 +1152,7 @@ index 40e87cda8c9bc79a889e5542f29af429a24b24d4..700515b52c27a4ccd5343176121e7318 |
| 1093 | const columnWrapperStyle = ctx.columnWrapperStyle; | 1152 | const columnWrapperStyle = ctx.columnWrapperStyle; |
| 1094 | const animSize = useValue$("totalSize"); | 1153 | const animSize = useValue$("totalSize"); |
| 1095 | const [readyToRender, numColumns, otherAxisSize = 0] = useArr$(["readyToRender", "numColumns", "otherAxisSize"]); | 1154 | const [readyToRender, numColumns, otherAxisSize = 0] = useArr$(["readyToRender", "numColumns", "otherAxisSize"]); |
| 1096 | @@ -5704,6 +5867,13 @@ var ContainersLayer = typedMemo(function ContainersLayer2({ | 1155 | @@ -5704,6 +5876,13 @@ var ContainersLayer = typedMemo(function ContainersLayer2({ |
| 1097 | opacity: isVisible ? 1 : 0, | 1156 | opacity: isVisible ? 1 : 0, |
| 1098 | width: animSize | 1157 | width: animSize |
| 1099 | } : { height: animSize, minWidth: otherAxisSize, opacity: isVisible ? 1 : 0 }; | 1158 | } : { height: animSize, minWidth: otherAxisSize, opacity: isVisible ? 1 : 0 }; |
| ... | @@ -1107,7 +1166,7 @@ index 40e87cda8c9bc79a889e5542f29af429a24b24d4..700515b52c27a4ccd5343176121e7318 | ... | @@ -1107,7 +1166,7 @@ index 40e87cda8c9bc79a889e5542f29af429a24b24d4..700515b52c27a4ccd5343176121e7318 |
| 1107 | if (columnWrapperStyle) { | 1166 | if (columnWrapperStyle) { |
| 1108 | const { columnGap, rowGap, gap } = columnWrapperStyle; | 1167 | const { columnGap, rowGap, gap } = columnWrapperStyle; |
| 1109 | const gapX = columnGap || gap || 0; | 1168 | const gapX = columnGap || gap || 0; |
| 1110 | @@ -5724,7 +5894,8 @@ var ContainersLayer = typedMemo(function ContainersLayer2({ | 1169 | @@ -5724,7 +5903,8 @@ var ContainersLayer = typedMemo(function ContainersLayer2({ |
| 1111 | } | 1170 | } |
| 1112 | } | 1171 | } |
| 1113 | } | 1172 | } |
| ... | @@ -1117,7 +1176,7 @@ index 40e87cda8c9bc79a889e5542f29af429a24b24d4..700515b52c27a4ccd5343176121e7318 | ... | @@ -1117,7 +1176,7 @@ index 40e87cda8c9bc79a889e5542f29af429a24b24d4..700515b52c27a4ccd5343176121e7318 |
| 1117 | }); | 1176 | }); |
| 1118 | var Containers = typedMemo(function Containers2({ | 1177 | var Containers = typedMemo(function Containers2({ |
| 1119 | freshDataTransitionEpoch, | 1178 | freshDataTransitionEpoch, |
| 1120 | @@ -5875,7 +6046,12 @@ var StyleSheet = StyleSheet$1; | 1179 | @@ -5875,7 +6055,12 @@ var StyleSheet = StyleSheet$1; |
| 1121 | | 1180 | |
| 1122 | // src/components/ListComponent.tsx | 1181 | // src/components/ListComponent.tsx |
| 1123 | var AlignItemsAtEndSpacer = typedMemo(function AlignItemsAtEndSpacer2({ horizontal }) { | 1182 | var AlignItemsAtEndSpacer = typedMemo(function AlignItemsAtEndSpacer2({ horizontal }) { |
| ... | @@ -1130,7 +1189,7 @@ index 40e87cda8c9bc79a889e5542f29af429a24b24d4..700515b52c27a4ccd5343176121e7318 | ... | @@ -1130,7 +1189,7 @@ index 40e87cda8c9bc79a889e5542f29af429a24b24d4..700515b52c27a4ccd5343176121e7318 |
| 1130 | if (alignItemsAtEndPadding <= 0) { | 1189 | if (alignItemsAtEndPadding <= 0) { |
| 1131 | return null; | 1190 | return null; |
| 1132 | } | 1191 | } |
| 1133 | @@ -5908,8 +6084,12 @@ var ListComponent = typedMemo(function ListComponent2({ | 1192 | @@ -5908,8 +6093,12 @@ var ListComponent = typedMemo(function ListComponent2({ |
| 1134 | refScrollView, | 1193 | refScrollView, |
| 1135 | renderScrollComponent, | 1194 | renderScrollComponent, |
| 1136 | onLayoutFooter, | 1195 | onLayoutFooter, |
| ... | @@ -1143,7 +1202,7 @@ index 40e87cda8c9bc79a889e5542f29af429a24b24d4..700515b52c27a4ccd5343176121e7318 | ... | @@ -1143,7 +1202,7 @@ index 40e87cda8c9bc79a889e5542f29af429a24b24d4..700515b52c27a4ccd5343176121e7318 |
| 1143 | scrollAdjustHandler, | 1202 | scrollAdjustHandler, |
| 1144 | snapToIndices, | 1203 | snapToIndices, |
| 1145 | stickyHeaderConfig, | 1204 | stickyHeaderConfig, |
| 1146 | @@ -5980,7 +6160,17 @@ var ListComponent = typedMemo(function ListComponent2({ | 1205 | @@ -5980,7 +6169,17 @@ var ListComponent = typedMemo(function ListComponent2({ |
| 1147 | SnapOrScroll, | 1206 | SnapOrScroll, |
| 1148 | { | 1207 | { |
| 1149 | ...rest, | 1208 | ...rest, |
| ... | @@ -1162,7 +1221,16 @@ index 40e87cda8c9bc79a889e5542f29af429a24b24d4..700515b52c27a4ccd5343176121e7318 | ... | @@ -1162,7 +1221,16 @@ index 40e87cda8c9bc79a889e5542f29af429a24b24d4..700515b52c27a4ccd5343176121e7318 |
| 1162 | contentContainerStyle: [ | 1221 | contentContainerStyle: [ |
| 1163 | horizontal ? { height: "100%" } : {}, | 1222 | horizontal ? { height: "100%" } : {}, |
| 1164 | contentContainerStyle, | 1223 | contentContainerStyle, |
| 1165 | @@ -7054,6 +7244,7 @@ var LegendListInner = typedForwardRef(function LegendListInner2(props, forwarded | 1224 | @@ -6730,7 +6929,7 @@ function createImperativeHandle(ctx, scheduleImperativeScrollCommit) { |
| | 1225 | endBuffered: state.endBuffered, |
| | 1226 | getAverageItemSizes: () => getAverageItemSizes(state), |
| | 1227 | indexByKey: (key) => state.indexByKey.get(key), |
| | 1228 | - isAtEnd: peek$(ctx, "isAtEnd"), |
| | 1229 | + isAtEnd: getIsAtEnd(ctx), |
| | 1230 | isAtStart: peek$(ctx, "isAtStart"), |
| | 1231 | isEndReached: state.isEndReached, |
| | 1232 | isNearEnd: peek$(ctx, "isNearEnd"), |
| | 1233 | @@ -7054,6 +7253,7 @@ var LegendListInner = typedForwardRef(function LegendListInner2(props, forwarded |
| 1166 | dataVersion, | 1234 | dataVersion, |
| 1167 | drawDistance = 250, | 1235 | drawDistance = 250, |
| 1168 | contentInsetEndAdjustment, | 1236 | contentInsetEndAdjustment, |
| ... | @@ -1170,7 +1238,7 @@ index 40e87cda8c9bc79a889e5542f29af429a24b24d4..700515b52c27a4ccd5343176121e7318 | ... | @@ -1170,7 +1238,7 @@ index 40e87cda8c9bc79a889e5542f29af429a24b24d4..700515b52c27a4ccd5343176121e7318 |
| 1170 | estimatedItemSize = 100, | 1238 | estimatedItemSize = 100, |
| 1171 | estimatedListSize, | 1239 | estimatedListSize, |
| 1172 | extraData, | 1240 | extraData, |
| 1173 | @@ -7111,10 +7302,12 @@ var LegendListInner = typedForwardRef(function LegendListInner2(props, forwarded | 1241 | @@ -7111,10 +7311,12 @@ var LegendListInner = typedForwardRef(function LegendListInner2(props, forwarded |
| 1174 | const animatedPropsInternal = props.animatedPropsInternal; | 1242 | const animatedPropsInternal = props.animatedPropsInternal; |
| 1175 | const anchoredEndSpaceOwner = (_a3 = props.anchoredEndSpaceOwnerInternal) != null ? _a3 : "list"; | 1243 | const anchoredEndSpaceOwner = (_a3 = props.anchoredEndSpaceOwnerInternal) != null ? _a3 : "list"; |
| 1176 | const positionComponentInternal = props.positionComponentInternal; | 1244 | const positionComponentInternal = props.positionComponentInternal; |
| ... | @@ -1183,7 +1251,7 @@ index 40e87cda8c9bc79a889e5542f29af429a24b24d4..700515b52c27a4ccd5343176121e7318 | ... | @@ -1183,7 +1251,7 @@ index 40e87cda8c9bc79a889e5542f29af429a24b24d4..700515b52c27a4ccd5343176121e7318 |
| 1183 | stickyPositionComponentInternal: _stickyPositionComponentInternal, | 1251 | stickyPositionComponentInternal: _stickyPositionComponentInternal, |
| 1184 | ...restProps | 1252 | ...restProps |
| 1185 | } = rest; | 1253 | } = rest; |
| 1186 | @@ -7179,7 +7372,7 @@ var LegendListInner = typedForwardRef(function LegendListInner2(props, forwarded | 1254 | @@ -7179,7 +7381,7 @@ var LegendListInner = typedForwardRef(function LegendListInner2(props, forwarded |
| 1187 | const combinedRef = useCombinedRef(refScroller, refScrollView); | 1255 | const combinedRef = useCombinedRef(refScroller, refScrollView); |
| 1188 | const keyExtractor = keyExtractorProp != null ? keyExtractorProp : ((_item, index) => index.toString()); | 1256 | const keyExtractor = keyExtractorProp != null ? keyExtractorProp : ((_item, index) => index.toString()); |
| 1189 | const stickyHeaderIndices = stickyHeaderIndicesProp; | 1257 | const stickyHeaderIndices = stickyHeaderIndicesProp; |
| ... | @@ -1192,7 +1260,7 @@ index 40e87cda8c9bc79a889e5542f29af429a24b24d4..700515b52c27a4ccd5343176121e7318 | ... | @@ -1192,7 +1260,7 @@ index 40e87cda8c9bc79a889e5542f29af429a24b24d4..700515b52c27a4ccd5343176121e7318 |
| 1192 | const previousContentInsetEndAdjustmentRef = useRef(contentInsetEndAdjustmentResolved); | 1260 | const previousContentInsetEndAdjustmentRef = useRef(contentInsetEndAdjustmentResolved); |
| 1193 | const alwaysRenderIndices = useMemo(() => { | 1261 | const alwaysRenderIndices = useMemo(() => { |
| 1194 | const indices = getAlwaysRenderIndices(alwaysRender, dataProp, keyExtractor, anchoredEndSpace == null ? void 0 : anchoredEndSpace.anchorIndex); | 1262 | const indices = getAlwaysRenderIndices(alwaysRender, dataProp, keyExtractor, anchoredEndSpace == null ? void 0 : anchoredEndSpace.anchorIndex); |
| 1195 | @@ -7320,6 +7513,7 @@ var LegendListInner = typedForwardRef(function LegendListInner2(props, forwarded | 1263 | @@ -7320,6 +7522,7 @@ var LegendListInner = typedForwardRef(function LegendListInner2(props, forwarded |
| 1196 | contentContainerAlignItems: contentContainerStyle.alignItems, | 1264 | contentContainerAlignItems: contentContainerStyle.alignItems, |
| 1197 | contentInset, | 1265 | contentInset, |
| 1198 | contentInsetEndAdjustment: contentInsetEndAdjustmentResolved, | 1266 | contentInsetEndAdjustment: contentInsetEndAdjustmentResolved, |
| ... | @@ -1200,7 +1268,7 @@ index 40e87cda8c9bc79a889e5542f29af429a24b24d4..700515b52c27a4ccd5343176121e7318 | ... | @@ -1200,7 +1268,7 @@ index 40e87cda8c9bc79a889e5542f29af429a24b24d4..700515b52c27a4ccd5343176121e7318 |
| 1200 | data: dataProp, | 1268 | data: dataProp, |
| 1201 | dataKey, | 1269 | dataKey, |
| 1202 | dataVersion, | 1270 | dataVersion, |
| 1203 | @@ -7351,6 +7545,7 @@ var LegendListInner = typedForwardRef(function LegendListInner2(props, forwarded | 1271 | @@ -7351,6 +7554,7 @@ var LegendListInner = typedForwardRef(function LegendListInner2(props, forwarded |
| 1204 | renderItem, | 1272 | renderItem, |
| 1205 | rtl, | 1273 | rtl, |
| 1206 | snapToIndices, | 1274 | snapToIndices, |
| ... | @@ -1208,7 +1276,7 @@ index 40e87cda8c9bc79a889e5542f29af429a24b24d4..700515b52c27a4ccd5343176121e7318 | ... | @@ -1208,7 +1276,7 @@ index 40e87cda8c9bc79a889e5542f29af429a24b24d4..700515b52c27a4ccd5343176121e7318 |
| 1208 | stickyHeaderIndicesArr: stickyHeaderIndices != null ? stickyHeaderIndices : [], | 1276 | stickyHeaderIndicesArr: stickyHeaderIndices != null ? stickyHeaderIndices : [], |
| 1209 | stickyHeaderIndicesSet: useMemo(() => new Set(stickyHeaderIndices != null ? stickyHeaderIndices : []), [stickyHeaderIndices == null ? void 0 : stickyHeaderIndices.join(",")]), | 1277 | stickyHeaderIndicesSet: useMemo(() => new Set(stickyHeaderIndices != null ? stickyHeaderIndices : []), [stickyHeaderIndices == null ? void 0 : stickyHeaderIndices.join(",")]), |
| 1210 | stickyPositionComponentInternal, | 1278 | stickyPositionComponentInternal, |
| 1211 | @@ -7402,6 +7597,13 @@ var LegendListInner = typedForwardRef(function LegendListInner2(props, forwarded | 1279 | @@ -7402,6 +7606,13 @@ var LegendListInner = typedForwardRef(function LegendListInner2(props, forwarded |
| 1212 | return void 0; | 1280 | return void 0; |
| 1213 | } | 1281 | } |
| 1214 | const resolvedOffset = (_a4 = initialScroll.contentOffset) != null ? _a4 : resolveInitialScrollOffset(ctx, initialScroll); | 1282 | const resolvedOffset = (_a4 = initialScroll.contentOffset) != null ? _a4 : resolveInitialScrollOffset(ctx, initialScroll); |
| ... | @@ -1222,7 +1290,7 @@ index 40e87cda8c9bc79a889e5542f29af429a24b24d4..700515b52c27a4ccd5343176121e7318 | ... | @@ -1222,7 +1290,7 @@ index 40e87cda8c9bc79a889e5542f29af429a24b24d4..700515b52c27a4ccd5343176121e7318 |
| 1222 | return usesBootstrapInitialScroll && ((_b2 = state.initialScrollSession) == null ? void 0 : _b2.kind) === "bootstrap" && Platform.OS === "web" ? void 0 : resolvedOffset; | 1290 | return usesBootstrapInitialScroll && ((_b2 = state.initialScrollSession) == null ? void 0 : _b2.kind) === "bootstrap" && Platform.OS === "web" ? void 0 : resolvedOffset; |
| 1223 | }, [usesBootstrapInitialScroll]); | 1291 | }, [usesBootstrapInitialScroll]); |
| 1224 | useLayoutEffect(() => { | 1292 | useLayoutEffect(() => { |
| 1225 | @@ -7526,6 +7728,7 @@ var LegendListInner = typedForwardRef(function LegendListInner2(props, forwarded | 1293 | @@ -7526,6 +7737,7 @@ var LegendListInner = typedForwardRef(function LegendListInner2(props, forwarded |
| 1226 | [ | 1294 | [ |
| 1227 | dataKey, | 1295 | dataKey, |
| 1228 | dataVersion, | 1296 | dataVersion, |
| ... | @@ -1230,7 +1298,7 @@ index 40e87cda8c9bc79a889e5542f29af429a24b24d4..700515b52c27a4ccd5343176121e7318 | ... | @@ -1230,7 +1298,7 @@ index 40e87cda8c9bc79a889e5542f29af429a24b24d4..700515b52c27a4ccd5343176121e7318 |
| 1230 | memoizedLastItemKeys.join(","), | 1298 | memoizedLastItemKeys.join(","), |
| 1231 | numColumnsProp, | 1299 | numColumnsProp, |
| 1232 | nextScrollAxisGap, | 1300 | nextScrollAxisGap, |
| 1233 | @@ -7622,6 +7825,7 @@ var LegendListInner = typedForwardRef(function LegendListInner2(props, forwarded | 1301 | @@ -7622,6 +7834,7 @@ var LegendListInner = typedForwardRef(function LegendListInner2(props, forwarded |
| 1234 | () => ({ | 1302 | () => ({ |
| 1235 | getRenderedItem: (key) => getRenderedItem(ctx, key), | 1303 | getRenderedItem: (key) => getRenderedItem(ctx, key), |
| 1236 | onMomentumScrollEnd: (event) => { | 1304 | onMomentumScrollEnd: (event) => { |
| ... | @@ -1238,7 +1306,7 @@ index 40e87cda8c9bc79a889e5542f29af429a24b24d4..700515b52c27a4ccd5343176121e7318 | ... | @@ -1238,7 +1306,7 @@ index 40e87cda8c9bc79a889e5542f29af429a24b24d4..700515b52c27a4ccd5343176121e7318 |
| 1238 | checkFinishedScrollFallback(ctx); | 1306 | checkFinishedScrollFallback(ctx); |
| 1239 | if (state.props.onMomentumScrollEnd) { | 1307 | if (state.props.onMomentumScrollEnd) { |
| 1240 | state.props.onMomentumScrollEnd(event); | 1308 | state.props.onMomentumScrollEnd(event); |
| 1241 | @@ -7630,6 +7834,8 @@ var LegendListInner = typedForwardRef(function LegendListInner2(props, forwarded | 1309 | @@ -7630,6 +7843,8 @@ var LegendListInner = typedForwardRef(function LegendListInner2(props, forwarded |
| 1242 | onScroll: (event) => onScroll(ctx, event), | 1310 | onScroll: (event) => onScroll(ctx, event), |
| 1243 | onScrollBeginDrag: (event) => { | 1311 | onScrollBeginDrag: (event) => { |
| 1244 | var _a4, _b2; | 1312 | var _a4, _b2; |
| ... | @@ -1247,7 +1315,7 @@ index 40e87cda8c9bc79a889e5542f29af429a24b24d4..700515b52c27a4ccd5343176121e7318 | ... | @@ -1247,7 +1315,7 @@ index 40e87cda8c9bc79a889e5542f29af429a24b24d4..700515b52c27a4ccd5343176121e7318 |
| 1247 | prepareReachedEdgeForNextUserScroll(ctx); | 1315 | prepareReachedEdgeForNextUserScroll(ctx); |
| 1248 | (_b2 = (_a4 = state.props).onScrollBeginDrag) == null ? void 0 : _b2.call(_a4, event); | 1316 | (_b2 = (_a4 = state.props).onScrollBeginDrag) == null ? void 0 : _b2.call(_a4, event); |
| 1249 | }, | 1317 | }, |
| 1250 | @@ -7655,11 +7861,18 @@ var LegendListInner = typedForwardRef(function LegendListInner2(props, forwarded | 1318 | @@ -7655,11 +7870,18 @@ var LegendListInner = typedForwardRef(function LegendListInner2(props, forwarded |
| 1251 | ListFooterComponent, | 1319 | ListFooterComponent, |
| 1252 | ListFooterComponentStyle, | 1320 | ListFooterComponentStyle, |
| 1253 | ListHeaderComponent, | 1321 | ListHeaderComponent, |
| ... | @@ -1358,7 +1426,7 @@ index e5043320700b12f34f4c0babbc341f85ca8135c1..2ce63830a28636b21937a0741fd0e613 | ... | @@ -1358,7 +1426,7 @@ index e5043320700b12f34f4c0babbc341f85ca8135c1..2ce63830a28636b21937a0741fd0e613 |
| 1358 | * Number of columns to render items in. | 1426 | * Number of columns to render items in. |
| 1359 | * @default 1 | 1427 | * @default 1 |
| 1360 | diff --git a/reanimated.js b/reanimated.js | 1428 | diff --git a/reanimated.js b/reanimated.js |
| 1361 | index f1265fad74189591b5aae86cf2e3a31f9c0fdb02..59e218cb79f56c34995fb86c5de5a71ff8ce9f4d 100644 | 1429 | index f1265fad74189591b5aae86cf2e3a31f9c0fdb02..fc03be2190c046f743ffde45ed189ee7868d0cec 100644 |
| 1362 | --- a/reanimated.js | 1430 | --- a/reanimated.js |
| 1363 | +++ b/reanimated.js | 1431 | +++ b/reanimated.js |
| 1364 | @@ -115,8 +115,10 @@ var ReanimatedPositionView = typedMemo(function ReanimatedPositionViewComponent( | 1432 | @@ -115,8 +115,10 @@ var ReanimatedPositionView = typedMemo(function ReanimatedPositionViewComponent( |
| ... | @@ -1404,7 +1472,7 @@ index f1265fad74189591b5aae86cf2e3a31f9c0fdb02..59e218cb79f56c34995fb86c5de5a71f | ... | @@ -1404,7 +1472,7 @@ index f1265fad74189591b5aae86cf2e3a31f9c0fdb02..59e218cb79f56c34995fb86c5de5a71f |
| 1404 | ref: refView, | 1472 | ref: refView, |
| 1405 | style: viewStyle, | 1473 | style: viewStyle, |
| 1406 | ...rest | 1474 | ...rest |
| 1407 | @@ -141,6 +162,96 @@ var ReanimatedPositionView = typedMemo(function ReanimatedPositionViewComponent( | 1475 | @@ -141,6 +162,95 @@ var ReanimatedPositionView = typedMemo(function ReanimatedPositionViewComponent( |
| 1408 | children | 1476 | children |
| 1409 | ); | 1477 | ); |
| 1410 | }); | 1478 | }); |
| ... | @@ -1418,12 +1486,12 @@ index f1265fad74189591b5aae86cf2e3a31f9c0fdb02..59e218cb79f56c34995fb86c5de5a71f | ... | @@ -1418,12 +1486,12 @@ index f1265fad74189591b5aae86cf2e3a31f9c0fdb02..59e218cb79f56c34995fb86c5de5a71f |
| 1418 | + const previousEpochRef = React__namespace.useRef(ctx.state.contentSizeAnimationEpoch || 0); | 1486 | + const previousEpochRef = React__namespace.useRef(ctx.state.contentSizeAnimationEpoch || 0); |
| 1419 | + const animationRunRef = React__namespace.useRef(0); | 1487 | + const animationRunRef = React__namespace.useRef(0); |
| 1420 | + const isAnimatingRef = React__namespace.useRef(false); | 1488 | + const isAnimatingRef = React__namespace.useRef(false); |
| 1421 | + const [isAnimating, setIsAnimating] = React__namespace.useState(false); | | |
| 1422 | + const transition = props.layoutTransition; | 1489 | + const transition = props.layoutTransition; |
| 1423 | + const canAnimate = !!transition && typeof transition.getAnimationAndConfig === "function"; | 1490 | + const canAnimate = !!transition && typeof transition.getAnimationAndConfig === "function"; |
| 1424 | + const renderEpoch = ctx.state.contentSizeAnimationEpoch || 0; | 1491 | + const renderEpoch = ctx.state.contentSizeAnimationEpoch || 0; |
| 1425 | + const startsEligibleAnimation = canAnimate && logicalSize !== previousLogicalSizeRef.current && renderEpoch !== previousEpochRef.current && ctx.state.contentSizeAnimationEligible; | 1492 | + // Keep the animated size attached after transitions finish. Reanimated |
| 1426 | + const useAnimatedAxis = isAnimating || startsEligibleAnimation; | 1493 | + // retains removed animated props, so switching to a static size leaves |
| | 1494 | + // native scroll bounds stuck while logical measurements keep changing. |
| 1427 | + const animatedStyle = Reanimated.useAnimatedStyle(() => { | 1495 | + const animatedStyle = Reanimated.useAnimatedStyle(() => { |
| 1428 | + const size = Math.max(0, baseSize.value + animatedDelta.value); | 1496 | + const size = Math.max(0, baseSize.value + animatedDelta.value); |
| 1429 | + return horizontal ? { width: size } : { height: size }; | 1497 | + return horizontal ? { width: size } : { height: size }; |
| ... | @@ -1433,7 +1501,6 @@ index f1265fad74189591b5aae86cf2e3a31f9c0fdb02..59e218cb79f56c34995fb86c5de5a71f | ... | @@ -1433,7 +1501,6 @@ index f1265fad74189591b5aae86cf2e3a31f9c0fdb02..59e218cb79f56c34995fb86c5de5a71f |
| 1433 | + return; | 1501 | + return; |
| 1434 | + } | 1502 | + } |
| 1435 | + isAnimatingRef.current = false; | 1503 | + isAnimatingRef.current = false; |
| 1436 | + setIsAnimating(false); | | |
| 1437 | + const state = ctx.state; | 1504 | + const state = ctx.state; |
| 1438 | + if (state.contentSizeAnimationActiveEpoch !== epoch) { | 1505 | + if (state.contentSizeAnimationActiveEpoch !== epoch) { |
| 1439 | + return; | 1506 | + return; |
| ... | @@ -1450,13 +1517,15 @@ index f1265fad74189591b5aae86cf2e3a31f9c0fdb02..59e218cb79f56c34995fb86c5de5a71f | ... | @@ -1450,13 +1517,15 @@ index f1265fad74189591b5aae86cf2e3a31f9c0fdb02..59e218cb79f56c34995fb86c5de5a71f |
| 1450 | + const previousLogicalSize = previousLogicalSizeRef.current; | 1517 | + const previousLogicalSize = previousLogicalSizeRef.current; |
| 1451 | + const delta = logicalSize - previousLogicalSize; | 1518 | + const delta = logicalSize - previousLogicalSize; |
| 1452 | + const isNewEpoch = epoch !== previousEpochRef.current; | 1519 | + const isNewEpoch = epoch !== previousEpochRef.current; |
| 1453 | + const isNewEligibleEpoch = canAnimate && isNewEpoch && state.contentSizeAnimationEligible; | 1520 | + // Retarget measurements received mid-animation, even in the same epoch. |
| | 1521 | + // Updating only the base keeps the old delta and can shrink scroll bounds. |
| | 1522 | + const shouldAnimate = canAnimate && (isAnimatingRef.current || isNewEpoch && state.contentSizeAnimationEligible); |
| 1454 | + previousLogicalSizeRef.current = logicalSize; | 1523 | + previousLogicalSizeRef.current = logicalSize; |
| 1455 | + previousEpochRef.current = epoch; | 1524 | + previousEpochRef.current = epoch; |
| 1456 | + if (!delta) { | 1525 | + if (!delta) { |
| 1457 | + return; | 1526 | + return; |
| 1458 | + } | 1527 | + } |
| 1459 | + if (!isNewEligibleEpoch) { | 1528 | + if (!shouldAnimate) { |
| 1460 | + baseSize.value = logicalSize; | 1529 | + baseSize.value = logicalSize; |
| 1461 | + if (signalName === "totalSize" && isNewEpoch && state.contentSizeAnimationEligible && !canAnimate) { | 1530 | + if (signalName === "totalSize" && isNewEpoch && state.contentSizeAnimationEligible && !canAnimate) { |
| 1462 | + state.contentSizeAnimationEligible = false; | 1531 | + state.contentSizeAnimationEligible = false; |
| ... | @@ -1480,7 +1549,6 @@ index f1265fad74189591b5aae86cf2e3a31f9c0fdb02..59e218cb79f56c34995fb86c5de5a71f | ... | @@ -1480,7 +1549,6 @@ index f1265fad74189591b5aae86cf2e3a31f9c0fdb02..59e218cb79f56c34995fb86c5de5a71f |
| 1480 | + state.contentSizeAnimationActiveSignals.add(signalName); | 1549 | + state.contentSizeAnimationActiveSignals.add(signalName); |
| 1481 | + const wasAnimating = isAnimatingRef.current; | 1550 | + const wasAnimating = isAnimatingRef.current; |
| 1482 | + isAnimatingRef.current = true; | 1551 | + isAnimatingRef.current = true; |
| 1483 | + setIsAnimating(true); | | |
| 1484 | + const run = ++animationRunRef.current; | 1552 | + const run = ++animationRunRef.current; |
| 1485 | + Reanimated.runOnUI((absoluteSize, previousSize, continuesAnimation, animationRun, animationEpoch) => { | 1553 | + Reanimated.runOnUI((absoluteSize, previousSize, continuesAnimation, animationRun, animationEpoch) => { |
| 1486 | + "worklet"; | 1554 | + "worklet"; |
| ... | @@ -1495,13 +1563,12 @@ index f1265fad74189591b5aae86cf2e3a31f9c0fdb02..59e218cb79f56c34995fb86c5de5a71f | ... | @@ -1495,13 +1563,12 @@ index f1265fad74189591b5aae86cf2e3a31f9c0fdb02..59e218cb79f56c34995fb86c5de5a71f |
| 1495 | + })); | 1563 | + })); |
| 1496 | + })(logicalSize, previousLogicalSize, wasAnimating, run, epoch); | 1564 | + })(logicalSize, previousLogicalSize, wasAnimating, run, epoch); |
| 1497 | + }, [baseSize, animatedDelta, canAnimate, completeAnimation, ctx.state, logicalSize, renderEpoch, signalName, transition]); | 1565 | + }, [baseSize, animatedDelta, canAnimate, completeAnimation, ctx.state, logicalSize, renderEpoch, signalName, transition]); |
| 1498 | + const sizeStyle = useAnimatedAxis ? animatedStyle : horizontal ? { width: logicalSize } : { height: logicalSize }; | 1566 | + return /* @__PURE__ */ React__namespace.createElement(Reanimated__default.default.View, { ...rest, style: [style, animatedStyle] }, children); |
| 1499 | + return /* @__PURE__ */ React__namespace.createElement(Reanimated__default.default.View, { ...rest, style: [style, sizeStyle] }, children); | | |
| 1500 | +}); | 1567 | +}); |
| 1501 | function setSharedValueValue(sharedValue, value) { | 1568 | function setSharedValueValue(sharedValue, value) { |
| 1502 | if (!sharedValue) { | 1569 | if (!sharedValue) { |
| 1503 | return; | 1570 | return; |
| 1504 | @@ -245,10 +356,19 @@ var LegendListForwardedRef = typedMemo( | 1571 | @@ -245,10 +355,19 @@ var LegendListForwardedRef = typedMemo( |
| 1505 | ); | 1572 | ); |
| 1506 | }; | 1573 | }; |
| 1507 | }, [hasItemLayoutAnimation, recycleItems]); | 1574 | }, [hasItemLayoutAnimation, recycleItems]); |
| ... | @@ -1522,7 +1589,7 @@ index f1265fad74189591b5aae86cf2e3a31f9c0fdb02..59e218cb79f56c34995fb86c5de5a71f | ... | @@ -1522,7 +1589,7 @@ index f1265fad74189591b5aae86cf2e3a31f9c0fdb02..59e218cb79f56c34995fb86c5de5a71f |
| 1522 | renderScrollComponent: renderReanimatedScrollComponent, | 1589 | renderScrollComponent: renderReanimatedScrollComponent, |
| 1523 | ...IsNewArchitecture ? { stickyPositionComponentInternal } : {} | 1590 | ...IsNewArchitecture ? { stickyPositionComponentInternal } : {} |
| 1524 | diff --git a/reanimated.mjs b/reanimated.mjs | 1591 | diff --git a/reanimated.mjs b/reanimated.mjs |
| 1525 | index 29a00d5dc084fd408a0e0a0a4d64e856d0ed1525..bd3c680eb4abeca786d538ebf7b23a5725398942 100644 | 1592 | index 29a00d5dc084fd408a0e0a0a4d64e856d0ed1525..6ab929250c8924e2d9919ee09a4f774238fbb90a 100644 |
| 1526 | --- a/reanimated.mjs | 1593 | --- a/reanimated.mjs |
| 1527 | +++ b/reanimated.mjs | 1594 | +++ b/reanimated.mjs |
| 1528 | @@ -1,7 +1,7 @@ | 1595 | @@ -1,7 +1,7 @@ |
| ... | @@ -1577,7 +1644,7 @@ index 29a00d5dc084fd408a0e0a0a4d64e856d0ed1525..bd3c680eb4abeca786d538ebf7b23a57 | ... | @@ -1577,7 +1644,7 @@ index 29a00d5dc084fd408a0e0a0a4d64e856d0ed1525..bd3c680eb4abeca786d538ebf7b23a57 |
| 1577 | ref: refView, | 1644 | ref: refView, |
| 1578 | style: viewStyle, | 1645 | style: viewStyle, |
| 1579 | ...rest | 1646 | ...rest |
| 1580 | @@ -117,6 +138,96 @@ var ReanimatedPositionView = typedMemo(function ReanimatedPositionViewComponent( | 1647 | @@ -117,6 +138,95 @@ var ReanimatedPositionView = typedMemo(function ReanimatedPositionViewComponent( |
| 1581 | children | 1648 | children |
| 1582 | ); | 1649 | ); |
| 1583 | }); | 1650 | }); |
| ... | @@ -1591,12 +1658,12 @@ index 29a00d5dc084fd408a0e0a0a4d64e856d0ed1525..bd3c680eb4abeca786d538ebf7b23a57 | ... | @@ -1591,12 +1658,12 @@ index 29a00d5dc084fd408a0e0a0a4d64e856d0ed1525..bd3c680eb4abeca786d538ebf7b23a57 |
| 1591 | + const previousEpochRef = React.useRef(ctx.state.contentSizeAnimationEpoch || 0); | 1658 | + const previousEpochRef = React.useRef(ctx.state.contentSizeAnimationEpoch || 0); |
| 1592 | + const animationRunRef = React.useRef(0); | 1659 | + const animationRunRef = React.useRef(0); |
| 1593 | + const isAnimatingRef = React.useRef(false); | 1660 | + const isAnimatingRef = React.useRef(false); |
| 1594 | + const [isAnimating, setIsAnimating] = React.useState(false); | | |
| 1595 | + const transition = props.layoutTransition; | 1661 | + const transition = props.layoutTransition; |
| 1596 | + const canAnimate = !!transition && typeof transition.getAnimationAndConfig === "function"; | 1662 | + const canAnimate = !!transition && typeof transition.getAnimationAndConfig === "function"; |
| 1597 | + const renderEpoch = ctx.state.contentSizeAnimationEpoch || 0; | 1663 | + const renderEpoch = ctx.state.contentSizeAnimationEpoch || 0; |
| 1598 | + const startsEligibleAnimation = canAnimate && logicalSize !== previousLogicalSizeRef.current && renderEpoch !== previousEpochRef.current && ctx.state.contentSizeAnimationEligible; | 1664 | + // Keep the animated size attached after transitions finish. Reanimated |
| 1599 | + const useAnimatedAxis = isAnimating || startsEligibleAnimation; | 1665 | + // retains removed animated props, so switching to a static size leaves |
| | 1666 | + // native scroll bounds stuck while logical measurements keep changing. |
| 1600 | + const animatedStyle = useAnimatedStyle(() => { | 1667 | + const animatedStyle = useAnimatedStyle(() => { |
| 1601 | + const size = Math.max(0, baseSize.value + animatedDelta.value); | 1668 | + const size = Math.max(0, baseSize.value + animatedDelta.value); |
| 1602 | + return horizontal ? { width: size } : { height: size }; | 1669 | + return horizontal ? { width: size } : { height: size }; |
| ... | @@ -1606,7 +1673,6 @@ index 29a00d5dc084fd408a0e0a0a4d64e856d0ed1525..bd3c680eb4abeca786d538ebf7b23a57 | ... | @@ -1606,7 +1673,6 @@ index 29a00d5dc084fd408a0e0a0a4d64e856d0ed1525..bd3c680eb4abeca786d538ebf7b23a57 |
| 1606 | + return; | 1673 | + return; |
| 1607 | + } | 1674 | + } |
| 1608 | + isAnimatingRef.current = false; | 1675 | + isAnimatingRef.current = false; |
| 1609 | + setIsAnimating(false); | | |
| 1610 | + const state = ctx.state; | 1676 | + const state = ctx.state; |
| 1611 | + if (state.contentSizeAnimationActiveEpoch !== epoch) { | 1677 | + if (state.contentSizeAnimationActiveEpoch !== epoch) { |
| 1612 | + return; | 1678 | + return; |
| ... | @@ -1623,13 +1689,15 @@ index 29a00d5dc084fd408a0e0a0a4d64e856d0ed1525..bd3c680eb4abeca786d538ebf7b23a57 | ... | @@ -1623,13 +1689,15 @@ index 29a00d5dc084fd408a0e0a0a4d64e856d0ed1525..bd3c680eb4abeca786d538ebf7b23a57 |
| 1623 | + const previousLogicalSize = previousLogicalSizeRef.current; | 1689 | + const previousLogicalSize = previousLogicalSizeRef.current; |
| 1624 | + const delta = logicalSize - previousLogicalSize; | 1690 | + const delta = logicalSize - previousLogicalSize; |
| 1625 | + const isNewEpoch = epoch !== previousEpochRef.current; | 1691 | + const isNewEpoch = epoch !== previousEpochRef.current; |
| 1626 | + const isNewEligibleEpoch = canAnimate && isNewEpoch && state.contentSizeAnimationEligible; | 1692 | + // Retarget measurements received mid-animation, even in the same epoch. |
| | 1693 | + // Updating only the base keeps the old delta and can shrink scroll bounds. |
| | 1694 | + const shouldAnimate = canAnimate && (isAnimatingRef.current || isNewEpoch && state.contentSizeAnimationEligible); |
| 1627 | + previousLogicalSizeRef.current = logicalSize; | 1695 | + previousLogicalSizeRef.current = logicalSize; |
| 1628 | + previousEpochRef.current = epoch; | 1696 | + previousEpochRef.current = epoch; |
| 1629 | + if (!delta) { | 1697 | + if (!delta) { |
| 1630 | + return; | 1698 | + return; |
| 1631 | + } | 1699 | + } |
| 1632 | + if (!isNewEligibleEpoch) { | 1700 | + if (!shouldAnimate) { |
| 1633 | + baseSize.value = logicalSize; | 1701 | + baseSize.value = logicalSize; |
| 1634 | + if (signalName === "totalSize" && isNewEpoch && state.contentSizeAnimationEligible && !canAnimate) { | 1702 | + if (signalName === "totalSize" && isNewEpoch && state.contentSizeAnimationEligible && !canAnimate) { |
| 1635 | + state.contentSizeAnimationEligible = false; | 1703 | + state.contentSizeAnimationEligible = false; |
| ... | @@ -1653,7 +1721,6 @@ index 29a00d5dc084fd408a0e0a0a4d64e856d0ed1525..bd3c680eb4abeca786d538ebf7b23a57 | ... | @@ -1653,7 +1721,6 @@ index 29a00d5dc084fd408a0e0a0a4d64e856d0ed1525..bd3c680eb4abeca786d538ebf7b23a57 |
| 1653 | + state.contentSizeAnimationActiveSignals.add(signalName); | 1721 | + state.contentSizeAnimationActiveSignals.add(signalName); |
| 1654 | + const wasAnimating = isAnimatingRef.current; | 1722 | + const wasAnimating = isAnimatingRef.current; |
| 1655 | + isAnimatingRef.current = true; | 1723 | + isAnimatingRef.current = true; |
| 1656 | + setIsAnimating(true); | | |
| 1657 | + const run = ++animationRunRef.current; | 1724 | + const run = ++animationRunRef.current; |
| 1658 | + runOnUI((absoluteSize, previousSize, continuesAnimation, animationRun, animationEpoch) => { | 1725 | + runOnUI((absoluteSize, previousSize, continuesAnimation, animationRun, animationEpoch) => { |
| 1659 | + "worklet"; | 1726 | + "worklet"; |
| ... | @@ -1668,13 +1735,12 @@ index 29a00d5dc084fd408a0e0a0a4d64e856d0ed1525..bd3c680eb4abeca786d538ebf7b23a57 | ... | @@ -1668,13 +1735,12 @@ index 29a00d5dc084fd408a0e0a0a4d64e856d0ed1525..bd3c680eb4abeca786d538ebf7b23a57 |
| 1668 | + })); | 1735 | + })); |
| 1669 | + })(logicalSize, previousLogicalSize, wasAnimating, run, epoch); | 1736 | + })(logicalSize, previousLogicalSize, wasAnimating, run, epoch); |
| 1670 | + }, [baseSize, animatedDelta, canAnimate, completeAnimation, ctx.state, logicalSize, renderEpoch, signalName, transition]); | 1737 | + }, [baseSize, animatedDelta, canAnimate, completeAnimation, ctx.state, logicalSize, renderEpoch, signalName, transition]); |
| 1671 | + const sizeStyle = useAnimatedAxis ? animatedStyle : horizontal ? { width: logicalSize } : { height: logicalSize }; | 1738 | + return /* @__PURE__ */ React.createElement(Reanimated.View, { ...rest, style: [style, animatedStyle] }, children); |
| 1672 | + return /* @__PURE__ */ React.createElement(Reanimated.View, { ...rest, style: [style, sizeStyle] }, children); | | |
| 1673 | +}); | 1739 | +}); |
| 1674 | function setSharedValueValue(sharedValue, value) { | 1740 | function setSharedValueValue(sharedValue, value) { |
| 1675 | if (!sharedValue) { | 1741 | if (!sharedValue) { |
| 1676 | return; | 1742 | return; |
| 1677 | @@ -221,10 +332,19 @@ var LegendListForwardedRef = typedMemo( | 1743 | @@ -221,10 +331,19 @@ var LegendListForwardedRef = typedMemo( |
| 1678 | ); | 1744 | ); |
| 1679 | }; | 1745 | }; |
| 1680 | }, [hasItemLayoutAnimation, recycleItems]); | 1746 | }, [hasItemLayoutAnimation, recycleItems]); |