@legendapp/list 3.3.8 → 3.3.10
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/.DS_Store +0 -0
- package/CHANGELOG.md +8 -0
- package/package.json +1 -1
- package/react-native.js +16 -6
- package/react-native.mjs +16 -6
- package/react-native.web.js +16 -6
- package/react-native.web.mjs +16 -6
- package/react.js +16 -6
- package/react.mjs +16 -6
package/.DS_Store
ADDED
|
Binary file
|
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,11 @@
|
|
|
1
|
+
## 3.3.10
|
|
2
|
+
|
|
3
|
+
- Fix: Changing `dataKey` no longer loses the new dataset's initial scroll position when React retries a render.
|
|
4
|
+
|
|
5
|
+
## 3.3.9
|
|
6
|
+
|
|
7
|
+
- Fix: Rows after an item that changes size stay in the correct positions while scrolling
|
|
8
|
+
|
|
1
9
|
## 3.3.8
|
|
2
10
|
|
|
3
11
|
- Feat: Add `experimental_hideItemsUntilMeasured` to make items never display at provisional layouts and wait for correct sizing, at the cost of an extra render per recycled row. This fixes cases where slow item renders could display with gaps/overlaps when scrolling up quickly on slow phones.
|
package/package.json
CHANGED
package/react-native.js
CHANGED
|
@@ -4391,7 +4391,9 @@ function calculateItemsInView(ctx, params = {}) {
|
|
|
4391
4391
|
const optimizeForVisibleWindow = !forceFullItemPositions && !dataChanged && numColumns > 1 && minIndexSizeChanged !== void 0;
|
|
4392
4392
|
updateItemPositions(ctx, dataChanged, {
|
|
4393
4393
|
doMVCP,
|
|
4394
|
-
|
|
4394
|
+
// A changed size shifts every following position. The scrolling early-exit
|
|
4395
|
+
// would leave the untouched suffix in the old coordinate space.
|
|
4396
|
+
forceFullUpdate: !!forceFullItemPositions || minIndexSizeChanged !== void 0,
|
|
4395
4397
|
optimizeForVisibleWindow,
|
|
4396
4398
|
scrollBottomBuffered,
|
|
4397
4399
|
scrollVelocity: speed,
|
|
@@ -7468,6 +7470,8 @@ var LegendListInner = typedForwardRef(function LegendListInner2(props, forwarded
|
|
|
7468
7470
|
refState.current = ctx.state;
|
|
7469
7471
|
}
|
|
7470
7472
|
const state = refState.current;
|
|
7473
|
+
const handledDataChangeEpochRef = React2.useRef(state.dataChangeEpoch);
|
|
7474
|
+
const handledFreshDataTransitionEpochRef = React2.useRef(state.freshDataTransitionEpoch);
|
|
7471
7475
|
const isFirstLocal = state.isFirst;
|
|
7472
7476
|
const previousAdaptiveRender = state.props.adaptiveRender;
|
|
7473
7477
|
const previousHideItemsUntilMeasured = state.props.hideItemsUntilMeasured;
|
|
@@ -7493,6 +7497,8 @@ var LegendListInner = typedForwardRef(function LegendListInner2(props, forwarded
|
|
|
7493
7497
|
if (shouldResetFreshDataLayout) {
|
|
7494
7498
|
state.freshDataTransitionEpoch += 1;
|
|
7495
7499
|
}
|
|
7500
|
+
const dataChangeEpoch = state.dataChangeEpoch;
|
|
7501
|
+
const freshDataTransitionEpoch = state.freshDataTransitionEpoch;
|
|
7496
7502
|
const throttledOnScroll = useThrottledOnScroll(onScrollProp != null ? onScrollProp : noopOnScroll, scrollEventThrottle != null ? scrollEventThrottle : 0);
|
|
7497
7503
|
const throttleScrollFn = scrollEventThrottle && onScrollProp ? throttledOnScroll : onScrollProp;
|
|
7498
7504
|
const didAnchoredEndSpaceAnchorIndexChange = !isFirstLocal && !didDataChangeLocal && ((_q = state.props.anchoredEndSpace) == null ? void 0 : _q.anchorIndex) !== (anchoredEndSpace == null ? void 0 : anchoredEndSpace.anchorIndex);
|
|
@@ -7620,7 +7626,11 @@ var LegendListInner = typedForwardRef(function LegendListInner2(props, forwarded
|
|
|
7620
7626
|
useDevChecks(props);
|
|
7621
7627
|
}
|
|
7622
7628
|
React2.useLayoutEffect(() => {
|
|
7623
|
-
|
|
7629
|
+
const didDataChange = handledDataChangeEpochRef.current !== dataChangeEpoch;
|
|
7630
|
+
const didStartFreshData = handledFreshDataTransitionEpochRef.current !== freshDataTransitionEpoch;
|
|
7631
|
+
handledDataChangeEpochRef.current = dataChangeEpoch;
|
|
7632
|
+
handledFreshDataTransitionEpochRef.current = freshDataTransitionEpoch;
|
|
7633
|
+
if (didStartFreshData) {
|
|
7624
7634
|
resetInitialRenderState(ctx, {
|
|
7625
7635
|
resetInitialScroll: !!initialScrollProp,
|
|
7626
7636
|
resetLayout: true
|
|
@@ -7628,8 +7638,8 @@ var LegendListInner = typedForwardRef(function LegendListInner2(props, forwarded
|
|
|
7628
7638
|
}
|
|
7629
7639
|
handleInitialScrollDataChange(ctx, {
|
|
7630
7640
|
dataLength: dataProp.length,
|
|
7631
|
-
didDataChange
|
|
7632
|
-
didStartFreshData
|
|
7641
|
+
didDataChange,
|
|
7642
|
+
didStartFreshData,
|
|
7633
7643
|
initialScrollAtEnd,
|
|
7634
7644
|
latestInitialScroll: initialScrollProp,
|
|
7635
7645
|
latestInitialScrollSessionKind: initialScrollUsesOffsetOnly ? "offset" : "bootstrap",
|
|
@@ -7639,8 +7649,8 @@ var LegendListInner = typedForwardRef(function LegendListInner2(props, forwarded
|
|
|
7639
7649
|
}, [
|
|
7640
7650
|
dataProp.length,
|
|
7641
7651
|
dataKey,
|
|
7642
|
-
|
|
7643
|
-
|
|
7652
|
+
dataChangeEpoch,
|
|
7653
|
+
freshDataTransitionEpoch,
|
|
7644
7654
|
initialScrollAtEnd,
|
|
7645
7655
|
stylePaddingEndState,
|
|
7646
7656
|
usesBootstrapInitialScroll
|
package/react-native.mjs
CHANGED
|
@@ -4370,7 +4370,9 @@ function calculateItemsInView(ctx, params = {}) {
|
|
|
4370
4370
|
const optimizeForVisibleWindow = !forceFullItemPositions && !dataChanged && numColumns > 1 && minIndexSizeChanged !== void 0;
|
|
4371
4371
|
updateItemPositions(ctx, dataChanged, {
|
|
4372
4372
|
doMVCP,
|
|
4373
|
-
|
|
4373
|
+
// A changed size shifts every following position. The scrolling early-exit
|
|
4374
|
+
// would leave the untouched suffix in the old coordinate space.
|
|
4375
|
+
forceFullUpdate: !!forceFullItemPositions || minIndexSizeChanged !== void 0,
|
|
4374
4376
|
optimizeForVisibleWindow,
|
|
4375
4377
|
scrollBottomBuffered,
|
|
4376
4378
|
scrollVelocity: speed,
|
|
@@ -7447,6 +7449,8 @@ var LegendListInner = typedForwardRef(function LegendListInner2(props, forwarded
|
|
|
7447
7449
|
refState.current = ctx.state;
|
|
7448
7450
|
}
|
|
7449
7451
|
const state = refState.current;
|
|
7452
|
+
const handledDataChangeEpochRef = useRef(state.dataChangeEpoch);
|
|
7453
|
+
const handledFreshDataTransitionEpochRef = useRef(state.freshDataTransitionEpoch);
|
|
7450
7454
|
const isFirstLocal = state.isFirst;
|
|
7451
7455
|
const previousAdaptiveRender = state.props.adaptiveRender;
|
|
7452
7456
|
const previousHideItemsUntilMeasured = state.props.hideItemsUntilMeasured;
|
|
@@ -7472,6 +7476,8 @@ var LegendListInner = typedForwardRef(function LegendListInner2(props, forwarded
|
|
|
7472
7476
|
if (shouldResetFreshDataLayout) {
|
|
7473
7477
|
state.freshDataTransitionEpoch += 1;
|
|
7474
7478
|
}
|
|
7479
|
+
const dataChangeEpoch = state.dataChangeEpoch;
|
|
7480
|
+
const freshDataTransitionEpoch = state.freshDataTransitionEpoch;
|
|
7475
7481
|
const throttledOnScroll = useThrottledOnScroll(onScrollProp != null ? onScrollProp : noopOnScroll, scrollEventThrottle != null ? scrollEventThrottle : 0);
|
|
7476
7482
|
const throttleScrollFn = scrollEventThrottle && onScrollProp ? throttledOnScroll : onScrollProp;
|
|
7477
7483
|
const didAnchoredEndSpaceAnchorIndexChange = !isFirstLocal && !didDataChangeLocal && ((_q = state.props.anchoredEndSpace) == null ? void 0 : _q.anchorIndex) !== (anchoredEndSpace == null ? void 0 : anchoredEndSpace.anchorIndex);
|
|
@@ -7599,7 +7605,11 @@ var LegendListInner = typedForwardRef(function LegendListInner2(props, forwarded
|
|
|
7599
7605
|
useDevChecks(props);
|
|
7600
7606
|
}
|
|
7601
7607
|
useLayoutEffect(() => {
|
|
7602
|
-
|
|
7608
|
+
const didDataChange = handledDataChangeEpochRef.current !== dataChangeEpoch;
|
|
7609
|
+
const didStartFreshData = handledFreshDataTransitionEpochRef.current !== freshDataTransitionEpoch;
|
|
7610
|
+
handledDataChangeEpochRef.current = dataChangeEpoch;
|
|
7611
|
+
handledFreshDataTransitionEpochRef.current = freshDataTransitionEpoch;
|
|
7612
|
+
if (didStartFreshData) {
|
|
7603
7613
|
resetInitialRenderState(ctx, {
|
|
7604
7614
|
resetInitialScroll: !!initialScrollProp,
|
|
7605
7615
|
resetLayout: true
|
|
@@ -7607,8 +7617,8 @@ var LegendListInner = typedForwardRef(function LegendListInner2(props, forwarded
|
|
|
7607
7617
|
}
|
|
7608
7618
|
handleInitialScrollDataChange(ctx, {
|
|
7609
7619
|
dataLength: dataProp.length,
|
|
7610
|
-
didDataChange
|
|
7611
|
-
didStartFreshData
|
|
7620
|
+
didDataChange,
|
|
7621
|
+
didStartFreshData,
|
|
7612
7622
|
initialScrollAtEnd,
|
|
7613
7623
|
latestInitialScroll: initialScrollProp,
|
|
7614
7624
|
latestInitialScrollSessionKind: initialScrollUsesOffsetOnly ? "offset" : "bootstrap",
|
|
@@ -7618,8 +7628,8 @@ var LegendListInner = typedForwardRef(function LegendListInner2(props, forwarded
|
|
|
7618
7628
|
}, [
|
|
7619
7629
|
dataProp.length,
|
|
7620
7630
|
dataKey,
|
|
7621
|
-
|
|
7622
|
-
|
|
7631
|
+
dataChangeEpoch,
|
|
7632
|
+
freshDataTransitionEpoch,
|
|
7623
7633
|
initialScrollAtEnd,
|
|
7624
7634
|
stylePaddingEndState,
|
|
7625
7635
|
usesBootstrapInitialScroll
|
package/react-native.web.js
CHANGED
|
@@ -4420,7 +4420,9 @@ function calculateItemsInView(ctx, params = {}) {
|
|
|
4420
4420
|
const optimizeForVisibleWindow = !forceFullItemPositions && !dataChanged && numColumns > 1 && minIndexSizeChanged !== void 0;
|
|
4421
4421
|
updateItemPositions(ctx, dataChanged, {
|
|
4422
4422
|
doMVCP,
|
|
4423
|
-
|
|
4423
|
+
// A changed size shifts every following position. The scrolling early-exit
|
|
4424
|
+
// would leave the untouched suffix in the old coordinate space.
|
|
4425
|
+
forceFullUpdate: !!forceFullItemPositions || minIndexSizeChanged !== void 0,
|
|
4424
4426
|
optimizeForVisibleWindow,
|
|
4425
4427
|
scrollBottomBuffered,
|
|
4426
4428
|
scrollVelocity: speed,
|
|
@@ -8073,6 +8075,8 @@ var LegendListInner = typedForwardRef(function LegendListInner2(props, forwarded
|
|
|
8073
8075
|
refState.current = ctx.state;
|
|
8074
8076
|
}
|
|
8075
8077
|
const state = refState.current;
|
|
8078
|
+
const handledDataChangeEpochRef = React3.useRef(state.dataChangeEpoch);
|
|
8079
|
+
const handledFreshDataTransitionEpochRef = React3.useRef(state.freshDataTransitionEpoch);
|
|
8076
8080
|
const isFirstLocal = state.isFirst;
|
|
8077
8081
|
const previousAdaptiveRender = state.props.adaptiveRender;
|
|
8078
8082
|
const previousHideItemsUntilMeasured = state.props.hideItemsUntilMeasured;
|
|
@@ -8098,6 +8102,8 @@ var LegendListInner = typedForwardRef(function LegendListInner2(props, forwarded
|
|
|
8098
8102
|
if (shouldResetFreshDataLayout) {
|
|
8099
8103
|
state.freshDataTransitionEpoch += 1;
|
|
8100
8104
|
}
|
|
8105
|
+
const dataChangeEpoch = state.dataChangeEpoch;
|
|
8106
|
+
const freshDataTransitionEpoch = state.freshDataTransitionEpoch;
|
|
8101
8107
|
const throttledOnScroll = useThrottledOnScroll(onScrollProp != null ? onScrollProp : noopOnScroll, scrollEventThrottle != null ? scrollEventThrottle : 0);
|
|
8102
8108
|
const throttleScrollFn = scrollEventThrottle && onScrollProp ? throttledOnScroll : onScrollProp;
|
|
8103
8109
|
const didAnchoredEndSpaceAnchorIndexChange = !isFirstLocal && !didDataChangeLocal && ((_q = state.props.anchoredEndSpace) == null ? void 0 : _q.anchorIndex) !== (anchoredEndSpace == null ? void 0 : anchoredEndSpace.anchorIndex);
|
|
@@ -8220,7 +8226,11 @@ var LegendListInner = typedForwardRef(function LegendListInner2(props, forwarded
|
|
|
8220
8226
|
useDevChecks(props);
|
|
8221
8227
|
}
|
|
8222
8228
|
React3.useLayoutEffect(() => {
|
|
8223
|
-
|
|
8229
|
+
const didDataChange = handledDataChangeEpochRef.current !== dataChangeEpoch;
|
|
8230
|
+
const didStartFreshData = handledFreshDataTransitionEpochRef.current !== freshDataTransitionEpoch;
|
|
8231
|
+
handledDataChangeEpochRef.current = dataChangeEpoch;
|
|
8232
|
+
handledFreshDataTransitionEpochRef.current = freshDataTransitionEpoch;
|
|
8233
|
+
if (didStartFreshData) {
|
|
8224
8234
|
resetInitialRenderState(ctx, {
|
|
8225
8235
|
resetInitialScroll: !!initialScrollProp,
|
|
8226
8236
|
resetLayout: true
|
|
@@ -8228,8 +8238,8 @@ var LegendListInner = typedForwardRef(function LegendListInner2(props, forwarded
|
|
|
8228
8238
|
}
|
|
8229
8239
|
handleInitialScrollDataChange(ctx, {
|
|
8230
8240
|
dataLength: dataProp.length,
|
|
8231
|
-
didDataChange
|
|
8232
|
-
didStartFreshData
|
|
8241
|
+
didDataChange,
|
|
8242
|
+
didStartFreshData,
|
|
8233
8243
|
initialScrollAtEnd,
|
|
8234
8244
|
latestInitialScroll: initialScrollProp,
|
|
8235
8245
|
latestInitialScrollSessionKind: initialScrollUsesOffsetOnly ? "offset" : "bootstrap",
|
|
@@ -8239,8 +8249,8 @@ var LegendListInner = typedForwardRef(function LegendListInner2(props, forwarded
|
|
|
8239
8249
|
}, [
|
|
8240
8250
|
dataProp.length,
|
|
8241
8251
|
dataKey,
|
|
8242
|
-
|
|
8243
|
-
|
|
8252
|
+
dataChangeEpoch,
|
|
8253
|
+
freshDataTransitionEpoch,
|
|
8244
8254
|
initialScrollAtEnd,
|
|
8245
8255
|
stylePaddingEndState,
|
|
8246
8256
|
usesBootstrapInitialScroll
|
package/react-native.web.mjs
CHANGED
|
@@ -4399,7 +4399,9 @@ function calculateItemsInView(ctx, params = {}) {
|
|
|
4399
4399
|
const optimizeForVisibleWindow = !forceFullItemPositions && !dataChanged && numColumns > 1 && minIndexSizeChanged !== void 0;
|
|
4400
4400
|
updateItemPositions(ctx, dataChanged, {
|
|
4401
4401
|
doMVCP,
|
|
4402
|
-
|
|
4402
|
+
// A changed size shifts every following position. The scrolling early-exit
|
|
4403
|
+
// would leave the untouched suffix in the old coordinate space.
|
|
4404
|
+
forceFullUpdate: !!forceFullItemPositions || minIndexSizeChanged !== void 0,
|
|
4403
4405
|
optimizeForVisibleWindow,
|
|
4404
4406
|
scrollBottomBuffered,
|
|
4405
4407
|
scrollVelocity: speed,
|
|
@@ -8052,6 +8054,8 @@ var LegendListInner = typedForwardRef(function LegendListInner2(props, forwarded
|
|
|
8052
8054
|
refState.current = ctx.state;
|
|
8053
8055
|
}
|
|
8054
8056
|
const state = refState.current;
|
|
8057
|
+
const handledDataChangeEpochRef = useRef(state.dataChangeEpoch);
|
|
8058
|
+
const handledFreshDataTransitionEpochRef = useRef(state.freshDataTransitionEpoch);
|
|
8055
8059
|
const isFirstLocal = state.isFirst;
|
|
8056
8060
|
const previousAdaptiveRender = state.props.adaptiveRender;
|
|
8057
8061
|
const previousHideItemsUntilMeasured = state.props.hideItemsUntilMeasured;
|
|
@@ -8077,6 +8081,8 @@ var LegendListInner = typedForwardRef(function LegendListInner2(props, forwarded
|
|
|
8077
8081
|
if (shouldResetFreshDataLayout) {
|
|
8078
8082
|
state.freshDataTransitionEpoch += 1;
|
|
8079
8083
|
}
|
|
8084
|
+
const dataChangeEpoch = state.dataChangeEpoch;
|
|
8085
|
+
const freshDataTransitionEpoch = state.freshDataTransitionEpoch;
|
|
8080
8086
|
const throttledOnScroll = useThrottledOnScroll(onScrollProp != null ? onScrollProp : noopOnScroll, scrollEventThrottle != null ? scrollEventThrottle : 0);
|
|
8081
8087
|
const throttleScrollFn = scrollEventThrottle && onScrollProp ? throttledOnScroll : onScrollProp;
|
|
8082
8088
|
const didAnchoredEndSpaceAnchorIndexChange = !isFirstLocal && !didDataChangeLocal && ((_q = state.props.anchoredEndSpace) == null ? void 0 : _q.anchorIndex) !== (anchoredEndSpace == null ? void 0 : anchoredEndSpace.anchorIndex);
|
|
@@ -8199,7 +8205,11 @@ var LegendListInner = typedForwardRef(function LegendListInner2(props, forwarded
|
|
|
8199
8205
|
useDevChecks(props);
|
|
8200
8206
|
}
|
|
8201
8207
|
useLayoutEffect(() => {
|
|
8202
|
-
|
|
8208
|
+
const didDataChange = handledDataChangeEpochRef.current !== dataChangeEpoch;
|
|
8209
|
+
const didStartFreshData = handledFreshDataTransitionEpochRef.current !== freshDataTransitionEpoch;
|
|
8210
|
+
handledDataChangeEpochRef.current = dataChangeEpoch;
|
|
8211
|
+
handledFreshDataTransitionEpochRef.current = freshDataTransitionEpoch;
|
|
8212
|
+
if (didStartFreshData) {
|
|
8203
8213
|
resetInitialRenderState(ctx, {
|
|
8204
8214
|
resetInitialScroll: !!initialScrollProp,
|
|
8205
8215
|
resetLayout: true
|
|
@@ -8207,8 +8217,8 @@ var LegendListInner = typedForwardRef(function LegendListInner2(props, forwarded
|
|
|
8207
8217
|
}
|
|
8208
8218
|
handleInitialScrollDataChange(ctx, {
|
|
8209
8219
|
dataLength: dataProp.length,
|
|
8210
|
-
didDataChange
|
|
8211
|
-
didStartFreshData
|
|
8220
|
+
didDataChange,
|
|
8221
|
+
didStartFreshData,
|
|
8212
8222
|
initialScrollAtEnd,
|
|
8213
8223
|
latestInitialScroll: initialScrollProp,
|
|
8214
8224
|
latestInitialScrollSessionKind: initialScrollUsesOffsetOnly ? "offset" : "bootstrap",
|
|
@@ -8218,8 +8228,8 @@ var LegendListInner = typedForwardRef(function LegendListInner2(props, forwarded
|
|
|
8218
8228
|
}, [
|
|
8219
8229
|
dataProp.length,
|
|
8220
8230
|
dataKey,
|
|
8221
|
-
|
|
8222
|
-
|
|
8231
|
+
dataChangeEpoch,
|
|
8232
|
+
freshDataTransitionEpoch,
|
|
8223
8233
|
initialScrollAtEnd,
|
|
8224
8234
|
stylePaddingEndState,
|
|
8225
8235
|
usesBootstrapInitialScroll
|
package/react.js
CHANGED
|
@@ -4420,7 +4420,9 @@ function calculateItemsInView(ctx, params = {}) {
|
|
|
4420
4420
|
const optimizeForVisibleWindow = !forceFullItemPositions && !dataChanged && numColumns > 1 && minIndexSizeChanged !== void 0;
|
|
4421
4421
|
updateItemPositions(ctx, dataChanged, {
|
|
4422
4422
|
doMVCP,
|
|
4423
|
-
|
|
4423
|
+
// A changed size shifts every following position. The scrolling early-exit
|
|
4424
|
+
// would leave the untouched suffix in the old coordinate space.
|
|
4425
|
+
forceFullUpdate: !!forceFullItemPositions || minIndexSizeChanged !== void 0,
|
|
4424
4426
|
optimizeForVisibleWindow,
|
|
4425
4427
|
scrollBottomBuffered,
|
|
4426
4428
|
scrollVelocity: speed,
|
|
@@ -8073,6 +8075,8 @@ var LegendListInner = typedForwardRef(function LegendListInner2(props, forwarded
|
|
|
8073
8075
|
refState.current = ctx.state;
|
|
8074
8076
|
}
|
|
8075
8077
|
const state = refState.current;
|
|
8078
|
+
const handledDataChangeEpochRef = React3.useRef(state.dataChangeEpoch);
|
|
8079
|
+
const handledFreshDataTransitionEpochRef = React3.useRef(state.freshDataTransitionEpoch);
|
|
8076
8080
|
const isFirstLocal = state.isFirst;
|
|
8077
8081
|
const previousAdaptiveRender = state.props.adaptiveRender;
|
|
8078
8082
|
const previousHideItemsUntilMeasured = state.props.hideItemsUntilMeasured;
|
|
@@ -8098,6 +8102,8 @@ var LegendListInner = typedForwardRef(function LegendListInner2(props, forwarded
|
|
|
8098
8102
|
if (shouldResetFreshDataLayout) {
|
|
8099
8103
|
state.freshDataTransitionEpoch += 1;
|
|
8100
8104
|
}
|
|
8105
|
+
const dataChangeEpoch = state.dataChangeEpoch;
|
|
8106
|
+
const freshDataTransitionEpoch = state.freshDataTransitionEpoch;
|
|
8101
8107
|
const throttledOnScroll = useThrottledOnScroll(onScrollProp != null ? onScrollProp : noopOnScroll, scrollEventThrottle != null ? scrollEventThrottle : 0);
|
|
8102
8108
|
const throttleScrollFn = scrollEventThrottle && onScrollProp ? throttledOnScroll : onScrollProp;
|
|
8103
8109
|
const didAnchoredEndSpaceAnchorIndexChange = !isFirstLocal && !didDataChangeLocal && ((_q = state.props.anchoredEndSpace) == null ? void 0 : _q.anchorIndex) !== (anchoredEndSpace == null ? void 0 : anchoredEndSpace.anchorIndex);
|
|
@@ -8220,7 +8226,11 @@ var LegendListInner = typedForwardRef(function LegendListInner2(props, forwarded
|
|
|
8220
8226
|
useDevChecks(props);
|
|
8221
8227
|
}
|
|
8222
8228
|
React3.useLayoutEffect(() => {
|
|
8223
|
-
|
|
8229
|
+
const didDataChange = handledDataChangeEpochRef.current !== dataChangeEpoch;
|
|
8230
|
+
const didStartFreshData = handledFreshDataTransitionEpochRef.current !== freshDataTransitionEpoch;
|
|
8231
|
+
handledDataChangeEpochRef.current = dataChangeEpoch;
|
|
8232
|
+
handledFreshDataTransitionEpochRef.current = freshDataTransitionEpoch;
|
|
8233
|
+
if (didStartFreshData) {
|
|
8224
8234
|
resetInitialRenderState(ctx, {
|
|
8225
8235
|
resetInitialScroll: !!initialScrollProp,
|
|
8226
8236
|
resetLayout: true
|
|
@@ -8228,8 +8238,8 @@ var LegendListInner = typedForwardRef(function LegendListInner2(props, forwarded
|
|
|
8228
8238
|
}
|
|
8229
8239
|
handleInitialScrollDataChange(ctx, {
|
|
8230
8240
|
dataLength: dataProp.length,
|
|
8231
|
-
didDataChange
|
|
8232
|
-
didStartFreshData
|
|
8241
|
+
didDataChange,
|
|
8242
|
+
didStartFreshData,
|
|
8233
8243
|
initialScrollAtEnd,
|
|
8234
8244
|
latestInitialScroll: initialScrollProp,
|
|
8235
8245
|
latestInitialScrollSessionKind: initialScrollUsesOffsetOnly ? "offset" : "bootstrap",
|
|
@@ -8239,8 +8249,8 @@ var LegendListInner = typedForwardRef(function LegendListInner2(props, forwarded
|
|
|
8239
8249
|
}, [
|
|
8240
8250
|
dataProp.length,
|
|
8241
8251
|
dataKey,
|
|
8242
|
-
|
|
8243
|
-
|
|
8252
|
+
dataChangeEpoch,
|
|
8253
|
+
freshDataTransitionEpoch,
|
|
8244
8254
|
initialScrollAtEnd,
|
|
8245
8255
|
stylePaddingEndState,
|
|
8246
8256
|
usesBootstrapInitialScroll
|
package/react.mjs
CHANGED
|
@@ -4399,7 +4399,9 @@ function calculateItemsInView(ctx, params = {}) {
|
|
|
4399
4399
|
const optimizeForVisibleWindow = !forceFullItemPositions && !dataChanged && numColumns > 1 && minIndexSizeChanged !== void 0;
|
|
4400
4400
|
updateItemPositions(ctx, dataChanged, {
|
|
4401
4401
|
doMVCP,
|
|
4402
|
-
|
|
4402
|
+
// A changed size shifts every following position. The scrolling early-exit
|
|
4403
|
+
// would leave the untouched suffix in the old coordinate space.
|
|
4404
|
+
forceFullUpdate: !!forceFullItemPositions || minIndexSizeChanged !== void 0,
|
|
4403
4405
|
optimizeForVisibleWindow,
|
|
4404
4406
|
scrollBottomBuffered,
|
|
4405
4407
|
scrollVelocity: speed,
|
|
@@ -8052,6 +8054,8 @@ var LegendListInner = typedForwardRef(function LegendListInner2(props, forwarded
|
|
|
8052
8054
|
refState.current = ctx.state;
|
|
8053
8055
|
}
|
|
8054
8056
|
const state = refState.current;
|
|
8057
|
+
const handledDataChangeEpochRef = useRef(state.dataChangeEpoch);
|
|
8058
|
+
const handledFreshDataTransitionEpochRef = useRef(state.freshDataTransitionEpoch);
|
|
8055
8059
|
const isFirstLocal = state.isFirst;
|
|
8056
8060
|
const previousAdaptiveRender = state.props.adaptiveRender;
|
|
8057
8061
|
const previousHideItemsUntilMeasured = state.props.hideItemsUntilMeasured;
|
|
@@ -8077,6 +8081,8 @@ var LegendListInner = typedForwardRef(function LegendListInner2(props, forwarded
|
|
|
8077
8081
|
if (shouldResetFreshDataLayout) {
|
|
8078
8082
|
state.freshDataTransitionEpoch += 1;
|
|
8079
8083
|
}
|
|
8084
|
+
const dataChangeEpoch = state.dataChangeEpoch;
|
|
8085
|
+
const freshDataTransitionEpoch = state.freshDataTransitionEpoch;
|
|
8080
8086
|
const throttledOnScroll = useThrottledOnScroll(onScrollProp != null ? onScrollProp : noopOnScroll, scrollEventThrottle != null ? scrollEventThrottle : 0);
|
|
8081
8087
|
const throttleScrollFn = scrollEventThrottle && onScrollProp ? throttledOnScroll : onScrollProp;
|
|
8082
8088
|
const didAnchoredEndSpaceAnchorIndexChange = !isFirstLocal && !didDataChangeLocal && ((_q = state.props.anchoredEndSpace) == null ? void 0 : _q.anchorIndex) !== (anchoredEndSpace == null ? void 0 : anchoredEndSpace.anchorIndex);
|
|
@@ -8199,7 +8205,11 @@ var LegendListInner = typedForwardRef(function LegendListInner2(props, forwarded
|
|
|
8199
8205
|
useDevChecks(props);
|
|
8200
8206
|
}
|
|
8201
8207
|
useLayoutEffect(() => {
|
|
8202
|
-
|
|
8208
|
+
const didDataChange = handledDataChangeEpochRef.current !== dataChangeEpoch;
|
|
8209
|
+
const didStartFreshData = handledFreshDataTransitionEpochRef.current !== freshDataTransitionEpoch;
|
|
8210
|
+
handledDataChangeEpochRef.current = dataChangeEpoch;
|
|
8211
|
+
handledFreshDataTransitionEpochRef.current = freshDataTransitionEpoch;
|
|
8212
|
+
if (didStartFreshData) {
|
|
8203
8213
|
resetInitialRenderState(ctx, {
|
|
8204
8214
|
resetInitialScroll: !!initialScrollProp,
|
|
8205
8215
|
resetLayout: true
|
|
@@ -8207,8 +8217,8 @@ var LegendListInner = typedForwardRef(function LegendListInner2(props, forwarded
|
|
|
8207
8217
|
}
|
|
8208
8218
|
handleInitialScrollDataChange(ctx, {
|
|
8209
8219
|
dataLength: dataProp.length,
|
|
8210
|
-
didDataChange
|
|
8211
|
-
didStartFreshData
|
|
8220
|
+
didDataChange,
|
|
8221
|
+
didStartFreshData,
|
|
8212
8222
|
initialScrollAtEnd,
|
|
8213
8223
|
latestInitialScroll: initialScrollProp,
|
|
8214
8224
|
latestInitialScrollSessionKind: initialScrollUsesOffsetOnly ? "offset" : "bootstrap",
|
|
@@ -8218,8 +8228,8 @@ var LegendListInner = typedForwardRef(function LegendListInner2(props, forwarded
|
|
|
8218
8228
|
}, [
|
|
8219
8229
|
dataProp.length,
|
|
8220
8230
|
dataKey,
|
|
8221
|
-
|
|
8222
|
-
|
|
8231
|
+
dataChangeEpoch,
|
|
8232
|
+
freshDataTransitionEpoch,
|
|
8223
8233
|
initialScrollAtEnd,
|
|
8224
8234
|
stylePaddingEndState,
|
|
8225
8235
|
usesBootstrapInitialScroll
|