@legendapp/list 1.0.5 → 1.0.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/index.js +42 -35
- package/index.mjs +42 -35
- package/package.json +1 -1
package/index.js
CHANGED
|
@@ -919,7 +919,7 @@ var LegendListInner = typedForwardRef(function LegendListInner2(props, forwarded
|
|
|
919
919
|
columnWrapperStyle,
|
|
920
920
|
keyExtractor: keyExtractorProp,
|
|
921
921
|
renderItem,
|
|
922
|
-
estimatedItemSize,
|
|
922
|
+
estimatedItemSize: estimatedItemSizeProp,
|
|
923
923
|
getEstimatedItemSize,
|
|
924
924
|
suggestEstimatedItemSize,
|
|
925
925
|
ListEmptyComponent,
|
|
@@ -959,6 +959,7 @@ var LegendListInner = typedForwardRef(function LegendListInner2(props, forwarded
|
|
|
959
959
|
ctx.columnWrapperStyle = columnWrapperStyle || (contentContainerStyle ? createColumnWrapperStyle(contentContainerStyle) : void 0);
|
|
960
960
|
const refScroller = React2.useRef(null);
|
|
961
961
|
const combinedRef = useCombinedRef(refScroller, refScrollView);
|
|
962
|
+
const estimatedItemSize = estimatedItemSizeProp != null ? estimatedItemSizeProp : DEFAULT_ITEM_SIZE;
|
|
962
963
|
const scrollBuffer = (drawDistance != null ? drawDistance : DEFAULT_DRAW_DISTANCE) || 1;
|
|
963
964
|
const keyExtractor = keyExtractorProp != null ? keyExtractorProp : (item, index) => index.toString();
|
|
964
965
|
const refState = React2.useRef();
|
|
@@ -972,7 +973,6 @@ var LegendListInner = typedForwardRef(function LegendListInner2(props, forwarded
|
|
|
972
973
|
return `${ret}`;
|
|
973
974
|
};
|
|
974
975
|
const getItemSize = (key, index, data, useAverageSize = false) => {
|
|
975
|
-
var _a;
|
|
976
976
|
const state = refState.current;
|
|
977
977
|
const sizeKnown = state.sizesKnown.get(key);
|
|
978
978
|
const sizePrevious = state.sizes.get(key);
|
|
@@ -992,7 +992,7 @@ var LegendListInner = typedForwardRef(function LegendListInner2(props, forwarded
|
|
|
992
992
|
return sizePrevious;
|
|
993
993
|
}
|
|
994
994
|
if (size === void 0) {
|
|
995
|
-
size =
|
|
995
|
+
size = getEstimatedItemSize ? getEstimatedItemSize(index, data) : estimatedItemSize;
|
|
996
996
|
}
|
|
997
997
|
state.sizes.set(key, size);
|
|
998
998
|
return size;
|
|
@@ -1013,7 +1013,7 @@ var LegendListInner = typedForwardRef(function LegendListInner2(props, forwarded
|
|
|
1013
1013
|
for (let i = 0; i < index; i++) {
|
|
1014
1014
|
offset += sizeFn(i);
|
|
1015
1015
|
}
|
|
1016
|
-
} else
|
|
1016
|
+
} else {
|
|
1017
1017
|
offset = index * estimatedItemSize;
|
|
1018
1018
|
}
|
|
1019
1019
|
const adjust = peek$(ctx, "containersDidLayout") ? ((_a = refState.current) == null ? void 0 : _a.scrollAdjustHandler.getAppliedAdjust()) || 0 : 0;
|
|
@@ -1355,7 +1355,7 @@ var LegendListInner = typedForwardRef(function LegendListInner2(props, forwarded
|
|
|
1355
1355
|
const previousScrollAdjust = scrollAdjustHandler.getAppliedAdjust();
|
|
1356
1356
|
const scrollExtra = Math.max(-16, Math.min(16, speed)) * 16;
|
|
1357
1357
|
let scrollState = state.scroll;
|
|
1358
|
-
const useAverageSize = !state.disableScrollJumpsFrom;
|
|
1358
|
+
const useAverageSize = !state.disableScrollJumpsFrom && speed >= 0 && peek$(ctx, "containersDidLayout");
|
|
1359
1359
|
if (!state.queuedInitialLayout && initialScrollIndex) {
|
|
1360
1360
|
const updatedOffset = calculateOffsetForIndex(initialScrollIndex);
|
|
1361
1361
|
scrollState = updatedOffset;
|
|
@@ -1385,8 +1385,6 @@ var LegendListInner = typedForwardRef(function LegendListInner2(props, forwarded
|
|
|
1385
1385
|
}
|
|
1386
1386
|
}
|
|
1387
1387
|
const scrollBottom = scroll + scrollLength;
|
|
1388
|
-
const prevStartBuffered = state.startBuffered;
|
|
1389
|
-
const prevEndBuffered = state.endBuffered;
|
|
1390
1388
|
let startNoBuffer = null;
|
|
1391
1389
|
let startBuffered = null;
|
|
1392
1390
|
let startBufferedId = null;
|
|
@@ -1437,7 +1435,17 @@ var LegendListInner = typedForwardRef(function LegendListInner2(props, forwarded
|
|
|
1437
1435
|
}
|
|
1438
1436
|
return topOffset;
|
|
1439
1437
|
};
|
|
1440
|
-
|
|
1438
|
+
let foundEnd = false;
|
|
1439
|
+
const prevNumContainers = ctx.values.get("numContainers");
|
|
1440
|
+
let maxIndexRendered = 0;
|
|
1441
|
+
for (let i = 0; i < prevNumContainers; i++) {
|
|
1442
|
+
const key = peek$(ctx, `containerItemKey${i}`);
|
|
1443
|
+
if (key !== void 0) {
|
|
1444
|
+
const index = state.indexByKey.get(key);
|
|
1445
|
+
maxIndexRendered = Math.max(maxIndexRendered, index);
|
|
1446
|
+
}
|
|
1447
|
+
}
|
|
1448
|
+
for (let i = Math.max(0, loopStart); i < data.length && (!foundEnd || i <= maxIndexRendered); i++) {
|
|
1441
1449
|
const id = getId(i);
|
|
1442
1450
|
const size = getItemSize(id, i, data[i], useAverageSize);
|
|
1443
1451
|
maxSizeInRow = Math.max(maxSizeInRow, size);
|
|
@@ -1450,21 +1458,23 @@ var LegendListInner = typedForwardRef(function LegendListInner2(props, forwarded
|
|
|
1450
1458
|
if (columns.get(id) !== column) {
|
|
1451
1459
|
columns.set(id, column);
|
|
1452
1460
|
}
|
|
1453
|
-
if (
|
|
1454
|
-
startNoBuffer
|
|
1455
|
-
|
|
1456
|
-
if (startBuffered === null && top + size > scroll - scrollBufferTop) {
|
|
1457
|
-
startBuffered = i;
|
|
1458
|
-
startBufferedId = id;
|
|
1459
|
-
}
|
|
1460
|
-
if (startNoBuffer !== null) {
|
|
1461
|
-
if (top <= scrollBottom) {
|
|
1462
|
-
endNoBuffer = i;
|
|
1461
|
+
if (!foundEnd) {
|
|
1462
|
+
if (startNoBuffer === null && top + size > scroll) {
|
|
1463
|
+
startNoBuffer = i;
|
|
1463
1464
|
}
|
|
1464
|
-
if (
|
|
1465
|
-
|
|
1466
|
-
|
|
1467
|
-
|
|
1465
|
+
if (startBuffered === null && top + size > scroll - scrollBufferTop) {
|
|
1466
|
+
startBuffered = i;
|
|
1467
|
+
startBufferedId = id;
|
|
1468
|
+
}
|
|
1469
|
+
if (startNoBuffer !== null) {
|
|
1470
|
+
if (top <= scrollBottom) {
|
|
1471
|
+
endNoBuffer = i;
|
|
1472
|
+
}
|
|
1473
|
+
if (top <= scrollBottom + scrollBufferBottom) {
|
|
1474
|
+
endBuffered = i;
|
|
1475
|
+
} else {
|
|
1476
|
+
foundEnd = true;
|
|
1477
|
+
}
|
|
1468
1478
|
}
|
|
1469
1479
|
}
|
|
1470
1480
|
column++;
|
|
@@ -1492,7 +1502,6 @@ var LegendListInner = typedForwardRef(function LegendListInner2(props, forwarded
|
|
|
1492
1502
|
} : void 0;
|
|
1493
1503
|
}
|
|
1494
1504
|
if (startBuffered !== null && endBuffered !== null) {
|
|
1495
|
-
const prevNumContainers = ctx.values.get("numContainers");
|
|
1496
1505
|
let numContainers = prevNumContainers;
|
|
1497
1506
|
let didWarnMoreContainers = false;
|
|
1498
1507
|
const allocatedContainers = /* @__PURE__ */ new Set();
|
|
@@ -1566,18 +1575,14 @@ var LegendListInner = typedForwardRef(function LegendListInner2(props, forwarded
|
|
|
1566
1575
|
const item = data[itemIndex];
|
|
1567
1576
|
if (item !== void 0) {
|
|
1568
1577
|
const id = getId(itemIndex);
|
|
1569
|
-
|
|
1570
|
-
|
|
1571
|
-
|
|
1572
|
-
const size = getItemSize(id, itemIndex, data[i]);
|
|
1573
|
-
if (pos + size >= scroll && pos <= scrollBottom || prevPos + size >= scroll && prevPos <= scrollBottom || endBuffered < prevEndBuffered || startBuffered > prevStartBuffered) {
|
|
1574
|
-
set$(ctx, `containerPosition${i}`, ANCHORED_POSITION_OUT_OF_VIEW);
|
|
1575
|
-
}
|
|
1578
|
+
const position = positions.get(id);
|
|
1579
|
+
if (position === void 0) {
|
|
1580
|
+
set$(ctx, `containerPosition${i}`, ANCHORED_POSITION_OUT_OF_VIEW);
|
|
1576
1581
|
} else {
|
|
1577
1582
|
const pos = {
|
|
1578
1583
|
type: "top",
|
|
1579
|
-
relativeCoordinate: positions.get(id)
|
|
1580
|
-
top: positions.get(id)
|
|
1584
|
+
relativeCoordinate: positions.get(id),
|
|
1585
|
+
top: positions.get(id)
|
|
1581
1586
|
};
|
|
1582
1587
|
const column2 = columns.get(id) || 1;
|
|
1583
1588
|
if (maintainVisibleContentPosition && itemIndex < anchorElementIndex) {
|
|
@@ -1951,11 +1956,10 @@ var LegendListInner = typedForwardRef(function LegendListInner2(props, forwarded
|
|
|
1951
1956
|
return { index, item: data[index], renderedItem };
|
|
1952
1957
|
}, []);
|
|
1953
1958
|
const doInitialAllocateContainers = () => {
|
|
1954
|
-
var _a;
|
|
1955
1959
|
const state = refState.current;
|
|
1956
1960
|
const { scrollLength, data } = state;
|
|
1957
1961
|
if (scrollLength > 0 && data.length > 0 && !peek$(ctx, "numContainers")) {
|
|
1958
|
-
const averageItemSize =
|
|
1962
|
+
const averageItemSize = getEstimatedItemSize ? getEstimatedItemSize(0, data[0]) : estimatedItemSize;
|
|
1959
1963
|
const numContainers = Math.ceil((scrollLength + scrollBuffer * 2) / averageItemSize) * numColumnsProp;
|
|
1960
1964
|
for (let i = 0; i < numContainers; i++) {
|
|
1961
1965
|
set$(ctx, `containerPosition${i}`, ANCHORED_POSITION_OUT_OF_VIEW);
|
|
@@ -2006,6 +2010,7 @@ var LegendListInner = typedForwardRef(function LegendListInner2(props, forwarded
|
|
|
2006
2010
|
const numColumns = peek$(ctx, "numColumns");
|
|
2007
2011
|
state.minIndexSizeChanged = state.minIndexSizeChanged !== void 0 ? Math.min(state.minIndexSizeChanged, index) : index;
|
|
2008
2012
|
const prevSize = getItemSize(itemKey, index, data);
|
|
2013
|
+
const prevSizeKnown = sizesKnown.get(itemKey);
|
|
2009
2014
|
let needsCalculate = false;
|
|
2010
2015
|
let needsUpdateContainersDidLayout = false;
|
|
2011
2016
|
sizesKnown.set(itemKey, size);
|
|
@@ -2048,7 +2053,9 @@ var LegendListInner = typedForwardRef(function LegendListInner2(props, forwarded
|
|
|
2048
2053
|
}
|
|
2049
2054
|
state.scrollForNextCalculateItemsInView = void 0;
|
|
2050
2055
|
addTotalSize(itemKey, diff, 0);
|
|
2051
|
-
|
|
2056
|
+
if (prevSizeKnown !== void 0 && Math.abs(prevSizeKnown - size) > 5) {
|
|
2057
|
+
doMaintainScrollAtEnd(false);
|
|
2058
|
+
}
|
|
2052
2059
|
if (onItemSizeChanged) {
|
|
2053
2060
|
onItemSizeChanged({
|
|
2054
2061
|
size,
|
package/index.mjs
CHANGED
|
@@ -898,7 +898,7 @@ var LegendListInner = typedForwardRef(function LegendListInner2(props, forwarded
|
|
|
898
898
|
columnWrapperStyle,
|
|
899
899
|
keyExtractor: keyExtractorProp,
|
|
900
900
|
renderItem,
|
|
901
|
-
estimatedItemSize,
|
|
901
|
+
estimatedItemSize: estimatedItemSizeProp,
|
|
902
902
|
getEstimatedItemSize,
|
|
903
903
|
suggestEstimatedItemSize,
|
|
904
904
|
ListEmptyComponent,
|
|
@@ -938,6 +938,7 @@ var LegendListInner = typedForwardRef(function LegendListInner2(props, forwarded
|
|
|
938
938
|
ctx.columnWrapperStyle = columnWrapperStyle || (contentContainerStyle ? createColumnWrapperStyle(contentContainerStyle) : void 0);
|
|
939
939
|
const refScroller = useRef(null);
|
|
940
940
|
const combinedRef = useCombinedRef(refScroller, refScrollView);
|
|
941
|
+
const estimatedItemSize = estimatedItemSizeProp != null ? estimatedItemSizeProp : DEFAULT_ITEM_SIZE;
|
|
941
942
|
const scrollBuffer = (drawDistance != null ? drawDistance : DEFAULT_DRAW_DISTANCE) || 1;
|
|
942
943
|
const keyExtractor = keyExtractorProp != null ? keyExtractorProp : (item, index) => index.toString();
|
|
943
944
|
const refState = useRef();
|
|
@@ -951,7 +952,6 @@ var LegendListInner = typedForwardRef(function LegendListInner2(props, forwarded
|
|
|
951
952
|
return `${ret}`;
|
|
952
953
|
};
|
|
953
954
|
const getItemSize = (key, index, data, useAverageSize = false) => {
|
|
954
|
-
var _a;
|
|
955
955
|
const state = refState.current;
|
|
956
956
|
const sizeKnown = state.sizesKnown.get(key);
|
|
957
957
|
const sizePrevious = state.sizes.get(key);
|
|
@@ -971,7 +971,7 @@ var LegendListInner = typedForwardRef(function LegendListInner2(props, forwarded
|
|
|
971
971
|
return sizePrevious;
|
|
972
972
|
}
|
|
973
973
|
if (size === void 0) {
|
|
974
|
-
size =
|
|
974
|
+
size = getEstimatedItemSize ? getEstimatedItemSize(index, data) : estimatedItemSize;
|
|
975
975
|
}
|
|
976
976
|
state.sizes.set(key, size);
|
|
977
977
|
return size;
|
|
@@ -992,7 +992,7 @@ var LegendListInner = typedForwardRef(function LegendListInner2(props, forwarded
|
|
|
992
992
|
for (let i = 0; i < index; i++) {
|
|
993
993
|
offset += sizeFn(i);
|
|
994
994
|
}
|
|
995
|
-
} else
|
|
995
|
+
} else {
|
|
996
996
|
offset = index * estimatedItemSize;
|
|
997
997
|
}
|
|
998
998
|
const adjust = peek$(ctx, "containersDidLayout") ? ((_a = refState.current) == null ? void 0 : _a.scrollAdjustHandler.getAppliedAdjust()) || 0 : 0;
|
|
@@ -1334,7 +1334,7 @@ var LegendListInner = typedForwardRef(function LegendListInner2(props, forwarded
|
|
|
1334
1334
|
const previousScrollAdjust = scrollAdjustHandler.getAppliedAdjust();
|
|
1335
1335
|
const scrollExtra = Math.max(-16, Math.min(16, speed)) * 16;
|
|
1336
1336
|
let scrollState = state.scroll;
|
|
1337
|
-
const useAverageSize = !state.disableScrollJumpsFrom;
|
|
1337
|
+
const useAverageSize = !state.disableScrollJumpsFrom && speed >= 0 && peek$(ctx, "containersDidLayout");
|
|
1338
1338
|
if (!state.queuedInitialLayout && initialScrollIndex) {
|
|
1339
1339
|
const updatedOffset = calculateOffsetForIndex(initialScrollIndex);
|
|
1340
1340
|
scrollState = updatedOffset;
|
|
@@ -1364,8 +1364,6 @@ var LegendListInner = typedForwardRef(function LegendListInner2(props, forwarded
|
|
|
1364
1364
|
}
|
|
1365
1365
|
}
|
|
1366
1366
|
const scrollBottom = scroll + scrollLength;
|
|
1367
|
-
const prevStartBuffered = state.startBuffered;
|
|
1368
|
-
const prevEndBuffered = state.endBuffered;
|
|
1369
1367
|
let startNoBuffer = null;
|
|
1370
1368
|
let startBuffered = null;
|
|
1371
1369
|
let startBufferedId = null;
|
|
@@ -1416,7 +1414,17 @@ var LegendListInner = typedForwardRef(function LegendListInner2(props, forwarded
|
|
|
1416
1414
|
}
|
|
1417
1415
|
return topOffset;
|
|
1418
1416
|
};
|
|
1419
|
-
|
|
1417
|
+
let foundEnd = false;
|
|
1418
|
+
const prevNumContainers = ctx.values.get("numContainers");
|
|
1419
|
+
let maxIndexRendered = 0;
|
|
1420
|
+
for (let i = 0; i < prevNumContainers; i++) {
|
|
1421
|
+
const key = peek$(ctx, `containerItemKey${i}`);
|
|
1422
|
+
if (key !== void 0) {
|
|
1423
|
+
const index = state.indexByKey.get(key);
|
|
1424
|
+
maxIndexRendered = Math.max(maxIndexRendered, index);
|
|
1425
|
+
}
|
|
1426
|
+
}
|
|
1427
|
+
for (let i = Math.max(0, loopStart); i < data.length && (!foundEnd || i <= maxIndexRendered); i++) {
|
|
1420
1428
|
const id = getId(i);
|
|
1421
1429
|
const size = getItemSize(id, i, data[i], useAverageSize);
|
|
1422
1430
|
maxSizeInRow = Math.max(maxSizeInRow, size);
|
|
@@ -1429,21 +1437,23 @@ var LegendListInner = typedForwardRef(function LegendListInner2(props, forwarded
|
|
|
1429
1437
|
if (columns.get(id) !== column) {
|
|
1430
1438
|
columns.set(id, column);
|
|
1431
1439
|
}
|
|
1432
|
-
if (
|
|
1433
|
-
startNoBuffer
|
|
1434
|
-
|
|
1435
|
-
if (startBuffered === null && top + size > scroll - scrollBufferTop) {
|
|
1436
|
-
startBuffered = i;
|
|
1437
|
-
startBufferedId = id;
|
|
1438
|
-
}
|
|
1439
|
-
if (startNoBuffer !== null) {
|
|
1440
|
-
if (top <= scrollBottom) {
|
|
1441
|
-
endNoBuffer = i;
|
|
1440
|
+
if (!foundEnd) {
|
|
1441
|
+
if (startNoBuffer === null && top + size > scroll) {
|
|
1442
|
+
startNoBuffer = i;
|
|
1442
1443
|
}
|
|
1443
|
-
if (
|
|
1444
|
-
|
|
1445
|
-
|
|
1446
|
-
|
|
1444
|
+
if (startBuffered === null && top + size > scroll - scrollBufferTop) {
|
|
1445
|
+
startBuffered = i;
|
|
1446
|
+
startBufferedId = id;
|
|
1447
|
+
}
|
|
1448
|
+
if (startNoBuffer !== null) {
|
|
1449
|
+
if (top <= scrollBottom) {
|
|
1450
|
+
endNoBuffer = i;
|
|
1451
|
+
}
|
|
1452
|
+
if (top <= scrollBottom + scrollBufferBottom) {
|
|
1453
|
+
endBuffered = i;
|
|
1454
|
+
} else {
|
|
1455
|
+
foundEnd = true;
|
|
1456
|
+
}
|
|
1447
1457
|
}
|
|
1448
1458
|
}
|
|
1449
1459
|
column++;
|
|
@@ -1471,7 +1481,6 @@ var LegendListInner = typedForwardRef(function LegendListInner2(props, forwarded
|
|
|
1471
1481
|
} : void 0;
|
|
1472
1482
|
}
|
|
1473
1483
|
if (startBuffered !== null && endBuffered !== null) {
|
|
1474
|
-
const prevNumContainers = ctx.values.get("numContainers");
|
|
1475
1484
|
let numContainers = prevNumContainers;
|
|
1476
1485
|
let didWarnMoreContainers = false;
|
|
1477
1486
|
const allocatedContainers = /* @__PURE__ */ new Set();
|
|
@@ -1545,18 +1554,14 @@ var LegendListInner = typedForwardRef(function LegendListInner2(props, forwarded
|
|
|
1545
1554
|
const item = data[itemIndex];
|
|
1546
1555
|
if (item !== void 0) {
|
|
1547
1556
|
const id = getId(itemIndex);
|
|
1548
|
-
|
|
1549
|
-
|
|
1550
|
-
|
|
1551
|
-
const size = getItemSize(id, itemIndex, data[i]);
|
|
1552
|
-
if (pos + size >= scroll && pos <= scrollBottom || prevPos + size >= scroll && prevPos <= scrollBottom || endBuffered < prevEndBuffered || startBuffered > prevStartBuffered) {
|
|
1553
|
-
set$(ctx, `containerPosition${i}`, ANCHORED_POSITION_OUT_OF_VIEW);
|
|
1554
|
-
}
|
|
1557
|
+
const position = positions.get(id);
|
|
1558
|
+
if (position === void 0) {
|
|
1559
|
+
set$(ctx, `containerPosition${i}`, ANCHORED_POSITION_OUT_OF_VIEW);
|
|
1555
1560
|
} else {
|
|
1556
1561
|
const pos = {
|
|
1557
1562
|
type: "top",
|
|
1558
|
-
relativeCoordinate: positions.get(id)
|
|
1559
|
-
top: positions.get(id)
|
|
1563
|
+
relativeCoordinate: positions.get(id),
|
|
1564
|
+
top: positions.get(id)
|
|
1560
1565
|
};
|
|
1561
1566
|
const column2 = columns.get(id) || 1;
|
|
1562
1567
|
if (maintainVisibleContentPosition && itemIndex < anchorElementIndex) {
|
|
@@ -1930,11 +1935,10 @@ var LegendListInner = typedForwardRef(function LegendListInner2(props, forwarded
|
|
|
1930
1935
|
return { index, item: data[index], renderedItem };
|
|
1931
1936
|
}, []);
|
|
1932
1937
|
const doInitialAllocateContainers = () => {
|
|
1933
|
-
var _a;
|
|
1934
1938
|
const state = refState.current;
|
|
1935
1939
|
const { scrollLength, data } = state;
|
|
1936
1940
|
if (scrollLength > 0 && data.length > 0 && !peek$(ctx, "numContainers")) {
|
|
1937
|
-
const averageItemSize =
|
|
1941
|
+
const averageItemSize = getEstimatedItemSize ? getEstimatedItemSize(0, data[0]) : estimatedItemSize;
|
|
1938
1942
|
const numContainers = Math.ceil((scrollLength + scrollBuffer * 2) / averageItemSize) * numColumnsProp;
|
|
1939
1943
|
for (let i = 0; i < numContainers; i++) {
|
|
1940
1944
|
set$(ctx, `containerPosition${i}`, ANCHORED_POSITION_OUT_OF_VIEW);
|
|
@@ -1985,6 +1989,7 @@ var LegendListInner = typedForwardRef(function LegendListInner2(props, forwarded
|
|
|
1985
1989
|
const numColumns = peek$(ctx, "numColumns");
|
|
1986
1990
|
state.minIndexSizeChanged = state.minIndexSizeChanged !== void 0 ? Math.min(state.minIndexSizeChanged, index) : index;
|
|
1987
1991
|
const prevSize = getItemSize(itemKey, index, data);
|
|
1992
|
+
const prevSizeKnown = sizesKnown.get(itemKey);
|
|
1988
1993
|
let needsCalculate = false;
|
|
1989
1994
|
let needsUpdateContainersDidLayout = false;
|
|
1990
1995
|
sizesKnown.set(itemKey, size);
|
|
@@ -2027,7 +2032,9 @@ var LegendListInner = typedForwardRef(function LegendListInner2(props, forwarded
|
|
|
2027
2032
|
}
|
|
2028
2033
|
state.scrollForNextCalculateItemsInView = void 0;
|
|
2029
2034
|
addTotalSize(itemKey, diff, 0);
|
|
2030
|
-
|
|
2035
|
+
if (prevSizeKnown !== void 0 && Math.abs(prevSizeKnown - size) > 5) {
|
|
2036
|
+
doMaintainScrollAtEnd(false);
|
|
2037
|
+
}
|
|
2031
2038
|
if (onItemSizeChanged) {
|
|
2032
2039
|
onItemSizeChanged({
|
|
2033
2040
|
size,
|
package/package.json
CHANGED