@legendapp/list 1.0.0-beta.25 → 1.0.0-beta.27

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.mjs CHANGED
@@ -550,6 +550,7 @@ var ScrollAdjustHandler = class {
550
550
  this.appliedAdjust = 0;
551
551
  this.busy = false;
552
552
  this.isPaused = false;
553
+ this.isDisabled = false;
553
554
  this.context = ctx;
554
555
  }
555
556
  doAjdust() {
@@ -557,6 +558,9 @@ var ScrollAdjustHandler = class {
557
558
  this.busy = false;
558
559
  }
559
560
  requestAdjust(adjust, onAdjusted) {
561
+ if (this.isDisabled) {
562
+ return;
563
+ }
560
564
  const oldAdjustTop = peek$(this.context, "scrollAdjust");
561
565
  if (oldAdjustTop === adjust) {
562
566
  return;
@@ -574,6 +578,9 @@ var ScrollAdjustHandler = class {
574
578
  pauseAdjust() {
575
579
  this.isPaused = true;
576
580
  }
581
+ setDisableAdjust(disable) {
582
+ this.isDisabled = disable;
583
+ }
577
584
  // return true if it was paused
578
585
  unPauseAdjust() {
579
586
  if (this.isPaused) {
@@ -848,18 +855,6 @@ var LegendListInner = typedForwardRef(function LegendListInner2(props, forwarded
848
855
  return 0;
849
856
  };
850
857
  const initialContentOffset = initialScrollOffset != null ? initialScrollOffset : useMemo(calculateOffsetForIndex, []);
851
- if (Platform.OS === "web") {
852
- useEffect(() => {
853
- var _a2;
854
- if (initialContentOffset) {
855
- (_a2 = refScroller.current) == null ? void 0 : _a2.scrollTo({
856
- x: horizontal ? initialContentOffset : 0,
857
- y: horizontal ? 0 : initialContentOffset,
858
- animated: false
859
- });
860
- }
861
- }, []);
862
- }
863
858
  if (!refState.current) {
864
859
  const initialScrollLength = Dimensions.get("window")[horizontal ? "width" : "height"];
865
860
  refState.current = {
@@ -903,7 +898,8 @@ var LegendListInner = typedForwardRef(function LegendListInner2(props, forwarded
903
898
  minIndexSizeChanged: 0,
904
899
  numPendingInitialLayout: 0,
905
900
  queuedCalculateItemsInView: 0,
906
- lastBatchingAction: Date.now()
901
+ lastBatchingAction: Date.now(),
902
+ onScroll: onScrollProp
907
903
  };
908
904
  if (maintainVisibleContentPosition) {
909
905
  if (initialScrollIndex) {
@@ -926,6 +922,7 @@ var LegendListInner = typedForwardRef(function LegendListInner2(props, forwarded
926
922
  }
927
923
  const didDataChange = refState.current.data !== dataProp;
928
924
  refState.current.data = dataProp;
925
+ refState.current.onScroll = onScrollProp;
929
926
  const getAnchorElementIndex = () => {
930
927
  const state = refState.current;
931
928
  if (state.anchorElement) {
@@ -975,7 +972,8 @@ var LegendListInner = typedForwardRef(function LegendListInner2(props, forwarded
975
972
  }, []);
976
973
  const getRowHeight = (n) => {
977
974
  const { rowHeights, data } = refState.current;
978
- if (numColumnsProp === 1) {
975
+ const numColumns = peek$(ctx, "numColumns");
976
+ if (numColumns === 1) {
979
977
  const id = getId(n);
980
978
  return getItemSize(id, n, data[n]);
981
979
  }
@@ -983,8 +981,8 @@ var LegendListInner = typedForwardRef(function LegendListInner2(props, forwarded
983
981
  return rowHeights.get(n) || 0;
984
982
  }
985
983
  let rowHeight = 0;
986
- const startEl = n * numColumnsProp;
987
- for (let i = startEl; i < startEl + numColumnsProp && i < data.length; i++) {
984
+ const startEl = n * numColumns;
985
+ for (let i = startEl; i < startEl + numColumns && i < data.length; i++) {
988
986
  const id = getId(i);
989
987
  const size = getItemSize(id, i, data[i]);
990
988
  rowHeight = Math.max(rowHeight, size);
@@ -1003,10 +1001,11 @@ var LegendListInner = typedForwardRef(function LegendListInner2(props, forwarded
1003
1001
  return /* @__PURE__ */ new Map();
1004
1002
  }
1005
1003
  const map = state.belowAnchorElementPositions || /* @__PURE__ */ new Map();
1004
+ const numColumns = peek$(ctx, "numColumns");
1006
1005
  for (let i = anchorIndex - 1; i >= 0; i--) {
1007
1006
  const id = getId(i);
1008
- const rowNumber = Math.floor(i / numColumnsProp);
1009
- if (i % numColumnsProp === 0) {
1007
+ const rowNumber = Math.floor(i / numColumns);
1008
+ if (i % numColumns === 0) {
1010
1009
  top -= getRowHeight(rowNumber);
1011
1010
  }
1012
1011
  map.set(id, top);
@@ -1043,6 +1042,7 @@ var LegendListInner = typedForwardRef(function LegendListInner2(props, forwarded
1043
1042
  return;
1044
1043
  }
1045
1044
  const topPad = (peek$(ctx, "stylePaddingTop") || 0) + (peek$(ctx, "headerSize") || 0);
1045
+ const numColumns = peek$(ctx, "numColumns");
1046
1046
  const previousScrollAdjust = scrollAdjustHandler.getAppliedAdjust();
1047
1047
  const scrollExtra = Math.max(-16, Math.min(16, speed)) * 16;
1048
1048
  const scroll = scrollState - previousScrollAdjust - topPad;
@@ -1098,7 +1098,6 @@ var LegendListInner = typedForwardRef(function LegendListInner2(props, forwarded
1098
1098
  }
1099
1099
  }
1100
1100
  }
1101
- const numColumns = peek$(ctx, "numColumns");
1102
1101
  const loopStartMod = loopStart % numColumns;
1103
1102
  if (loopStartMod > 0) {
1104
1103
  loopStart -= loopStartMod;
@@ -1255,7 +1254,7 @@ var LegendListInner = typedForwardRef(function LegendListInner2(props, forwarded
1255
1254
  };
1256
1255
  const column2 = columns.get(id) || 1;
1257
1256
  if (maintainVisibleContentPosition && itemIndex < anchorElementIndex) {
1258
- const currentRow = Math.floor(itemIndex / numColumnsProp);
1257
+ const currentRow = Math.floor(itemIndex / numColumns);
1259
1258
  const rowHeight = getRowHeight(currentRow);
1260
1259
  const elementHeight = getItemSize(id, itemIndex, data[i]);
1261
1260
  const diff = rowHeight - elementHeight;
@@ -1413,13 +1412,14 @@ var LegendListInner = typedForwardRef(function LegendListInner2(props, forwarded
1413
1412
  }
1414
1413
  };
1415
1414
  const calcTotalSizesAndPositions = ({ forgetPositions = false }) => {
1416
- var _a2, _b2, _c2;
1415
+ var _a2, _b2, _c2, _d2;
1417
1416
  let totalSize = 0;
1418
1417
  let totalSizeBelowIndex = 0;
1419
1418
  const indexByKey = /* @__PURE__ */ new Map();
1420
1419
  const newPositions = /* @__PURE__ */ new Map();
1421
1420
  let column = 1;
1422
1421
  let maxSizeInRow = 0;
1422
+ const numColumns = (_a2 = peek$(ctx, "numColumns")) != null ? _a2 : numColumnsProp;
1423
1423
  if (!refState.current) {
1424
1424
  return;
1425
1425
  }
@@ -1448,8 +1448,8 @@ var LegendListInner = typedForwardRef(function LegendListInner2(props, forwarded
1448
1448
  id: getId(0)
1449
1449
  };
1450
1450
  refState.current.anchorElement = newAnchorElement;
1451
- (_a2 = refState.current.belowAnchorElementPositions) == null ? void 0 : _a2.clear();
1452
- (_b2 = refScroller.current) == null ? void 0 : _b2.scrollTo({ x: 0, y: 0, animated: false });
1451
+ (_b2 = refState.current.belowAnchorElementPositions) == null ? void 0 : _b2.clear();
1452
+ (_c2 = refScroller.current) == null ? void 0 : _c2.scrollTo({ x: 0, y: 0, animated: false });
1453
1453
  setTimeout(() => {
1454
1454
  calculateItemsInView();
1455
1455
  }, 0);
@@ -1464,7 +1464,7 @@ var LegendListInner = typedForwardRef(function LegendListInner2(props, forwarded
1464
1464
  } else {
1465
1465
  refState.current.startBufferedId = void 0;
1466
1466
  }
1467
- (_c2 = refScroller.current) == null ? void 0 : _c2.scrollTo({ x: 0, y: 0, animated: false });
1467
+ (_d2 = refScroller.current) == null ? void 0 : _d2.scrollTo({ x: 0, y: 0, animated: false });
1468
1468
  setTimeout(() => {
1469
1469
  calculateItemsInView();
1470
1470
  }, 0);
@@ -1477,7 +1477,7 @@ var LegendListInner = typedForwardRef(function LegendListInner2(props, forwarded
1477
1477
  const size = getItemSize(key, i, dataProp[i]);
1478
1478
  maxSizeInRow = Math.max(maxSizeInRow, size);
1479
1479
  column++;
1480
- if (column > numColumnsProp) {
1480
+ if (column > numColumns) {
1481
1481
  if (maintainVisibleContentPosition && anchorElementIndex !== void 0 && i < anchorElementIndex) {
1482
1482
  totalSizeBelowIndex += maxSizeInRow;
1483
1483
  }
@@ -1497,6 +1497,20 @@ var LegendListInner = typedForwardRef(function LegendListInner2(props, forwarded
1497
1497
  addTotalSize(null, totalSize, totalSizeBelowIndex);
1498
1498
  };
1499
1499
  const isFirst = !refState.current.renderItem;
1500
+ const memoizedLastItemKeys = useMemo(() => {
1501
+ if (!dataProp.length) return /* @__PURE__ */ new Set();
1502
+ return new Set(
1503
+ Array.from({ length: Math.min(numColumnsProp, dataProp.length) }, (_, i) => getId(dataProp.length - 1 - i))
1504
+ );
1505
+ }, [dataProp.length, numColumnsProp, dataProp.slice(-numColumnsProp).toString()]);
1506
+ const initalizeStateVars = () => {
1507
+ set$(ctx, "lastItemKeys", memoizedLastItemKeys);
1508
+ set$(ctx, "numColumns", numColumnsProp);
1509
+ set$(ctx, "stylePaddingTop", stylePaddingTop);
1510
+ };
1511
+ if (isFirst) {
1512
+ initalizeStateVars();
1513
+ }
1500
1514
  if (isFirst || didDataChange || numColumnsProp !== peek$(ctx, "numColumns")) {
1501
1515
  refState.current.lastBatchingAction = Date.now();
1502
1516
  if (!keyExtractorProp && !isFirst && didDataChange) {
@@ -1506,30 +1520,19 @@ var LegendListInner = typedForwardRef(function LegendListInner2(props, forwarded
1506
1520
  calcTotalSizesAndPositions({ forgetPositions: false });
1507
1521
  }
1508
1522
  useEffect(() => {
1509
- checkResetContainers(
1510
- /*isFirst*/
1511
- isFirst
1512
- );
1523
+ const didAllocateContainers = doInitialAllocateContainers();
1524
+ if (!didAllocateContainers) {
1525
+ checkResetContainers(
1526
+ /*isFirst*/
1527
+ isFirst
1528
+ );
1529
+ }
1513
1530
  }, [isFirst, dataProp, numColumnsProp]);
1514
1531
  useEffect(() => {
1515
1532
  set$(ctx, "extraData", extraData);
1516
1533
  }, [extraData]);
1517
1534
  refState.current.renderItem = renderItem;
1518
- const memoizedLastItemKeys = useMemo(() => {
1519
- if (!dataProp.length) return [];
1520
- return new Set(
1521
- Array.from({ length: Math.min(numColumnsProp, dataProp.length) }, (_, i) => getId(dataProp.length - 1 - i))
1522
- );
1523
- }, [dataProp.length, numColumnsProp, dataProp.slice(-numColumnsProp).toString()]);
1524
1535
  const stylePaddingTop = (_d = (_c = (_a = StyleSheet.flatten(style)) == null ? void 0 : _a.paddingTop) != null ? _c : (_b = StyleSheet.flatten(contentContainerStyle)) == null ? void 0 : _b.paddingTop) != null ? _d : 0;
1525
- const initalizeStateVars = () => {
1526
- set$(ctx, "lastItemKeys", memoizedLastItemKeys);
1527
- set$(ctx, "numColumns", numColumnsProp);
1528
- set$(ctx, "stylePaddingTop", stylePaddingTop);
1529
- };
1530
- if (isFirst) {
1531
- initalizeStateVars();
1532
- }
1533
1536
  useEffect(initalizeStateVars, [memoizedLastItemKeys, numColumnsProp, stylePaddingTop]);
1534
1537
  const getRenderedItem = useCallback((key) => {
1535
1538
  var _a2, _b2;
@@ -1557,6 +1560,7 @@ var LegendListInner = typedForwardRef(function LegendListInner2(props, forwarded
1557
1560
  const renderedItem = (_b2 = (_a2 = refState.current).renderItem) == null ? void 0 : _b2.call(_a2, {
1558
1561
  item: data[index],
1559
1562
  index,
1563
+ extraData: peek$(ctx, "extraData"),
1560
1564
  useViewability: useViewability2,
1561
1565
  useViewabilityAmount: useViewabilityAmount2,
1562
1566
  useRecyclingEffect: useRecyclingEffect2,
@@ -1567,9 +1571,9 @@ var LegendListInner = typedForwardRef(function LegendListInner2(props, forwarded
1567
1571
  const doInitialAllocateContainers = () => {
1568
1572
  var _a2;
1569
1573
  const state = refState.current;
1570
- const scrollLength = state.scrollLength;
1571
- if (scrollLength > 0 && !peek$(ctx, "numContainers")) {
1572
- const averageItemSize = (_a2 = estimatedItemSize != null ? estimatedItemSize : getEstimatedItemSize == null ? void 0 : getEstimatedItemSize(0, dataProp[0])) != null ? _a2 : DEFAULT_ITEM_SIZE;
1574
+ const { scrollLength, data } = state;
1575
+ if (scrollLength > 0 && data.length > 0 && !peek$(ctx, "numContainers")) {
1576
+ const averageItemSize = (_a2 = estimatedItemSize != null ? estimatedItemSize : getEstimatedItemSize == null ? void 0 : getEstimatedItemSize(0, data[0])) != null ? _a2 : DEFAULT_ITEM_SIZE;
1573
1577
  const numContainers = Math.ceil((scrollLength + scrollBuffer * 2) / averageItemSize) * numColumnsProp;
1574
1578
  for (let i = 0; i < numContainers; i++) {
1575
1579
  set$(ctx, `containerPosition${i}`, ANCHORED_POSITION_OUT_OF_VIEW);
@@ -1584,6 +1588,7 @@ var LegendListInner = typedForwardRef(function LegendListInner2(props, forwarded
1584
1588
  } else {
1585
1589
  calculateItemsInView();
1586
1590
  }
1591
+ return true;
1587
1592
  }
1588
1593
  };
1589
1594
  useInit(() => {
@@ -1604,14 +1609,13 @@ var LegendListInner = typedForwardRef(function LegendListInner2(props, forwarded
1604
1609
  state.minIndexSizeChanged = state.minIndexSizeChanged !== void 0 ? Math.min(state.minIndexSizeChanged, index) : index;
1605
1610
  const prevSize = getItemSize(itemKey, index, data);
1606
1611
  let needsCalculate = false;
1612
+ let needsUpdateContainersDidLayout = false;
1607
1613
  if (state.numPendingInitialLayout > 0) {
1608
1614
  state.numPendingInitialLayout--;
1609
1615
  if (state.numPendingInitialLayout === 0) {
1610
1616
  needsCalculate = true;
1611
1617
  state.numPendingInitialLayout = -1;
1612
- queueMicrotask(() => {
1613
- set$(ctx, "containersDidLayout", true);
1614
- });
1618
+ needsUpdateContainersDidLayout = true;
1615
1619
  }
1616
1620
  }
1617
1621
  if (!prevSize || Math.abs(prevSize - size) > 0.5) {
@@ -1663,13 +1667,27 @@ var LegendListInner = typedForwardRef(function LegendListInner2(props, forwarded
1663
1667
  if (needsCalculate) {
1664
1668
  const scrollVelocity = state.scrollVelocity;
1665
1669
  if ((Number.isNaN(scrollVelocity) || Math.abs(scrollVelocity) < 1) && (!waitForInitialLayout || state.numPendingInitialLayout < 0)) {
1670
+ const setDidLayout = () => {
1671
+ set$(ctx, "containersDidLayout", true);
1672
+ if (Platform.OS === "web") {
1673
+ setTimeout(() => {
1674
+ state.scrollAdjustHandler.setDisableAdjust(false);
1675
+ }, 32);
1676
+ }
1677
+ };
1666
1678
  if (Date.now() - state.lastBatchingAction < 500) {
1667
1679
  state.queuedCalculateItemsInView = requestAnimationFrame(() => {
1668
1680
  state.queuedCalculateItemsInView = void 0;
1669
1681
  calculateItemsInView();
1682
+ if (needsUpdateContainersDidLayout) {
1683
+ setDidLayout();
1684
+ }
1670
1685
  });
1671
1686
  } else {
1672
1687
  calculateItemsInView();
1688
+ if (needsUpdateContainersDidLayout) {
1689
+ queueMicrotask(setDidLayout);
1690
+ }
1673
1691
  }
1674
1692
  }
1675
1693
  }
@@ -1680,6 +1698,7 @@ var LegendListInner = typedForwardRef(function LegendListInner2(props, forwarded
1680
1698
  const didChange = scrollLength !== state.scrollLength;
1681
1699
  state.scrollLength = scrollLength;
1682
1700
  state.lastBatchingAction = Date.now();
1701
+ state.scrollForNextCalculateItemsInView = void 0;
1683
1702
  doInitialAllocateContainers();
1684
1703
  doMaintainScrollAtEnd(false);
1685
1704
  doUpdatePaddingTop();
@@ -1703,18 +1722,18 @@ var LegendListInner = typedForwardRef(function LegendListInner2(props, forwarded
1703
1722
  }, []);
1704
1723
  const handleScroll = useCallback(
1705
1724
  (event, fromSelf) => {
1706
- var _a2, _b2, _c2;
1725
+ var _a2, _b2, _c2, _d2;
1707
1726
  if (((_b2 = (_a2 = event.nativeEvent) == null ? void 0 : _a2.contentSize) == null ? void 0 : _b2.height) === 0 && ((_c2 = event.nativeEvent.contentSize) == null ? void 0 : _c2.width) === 0) {
1708
1727
  return;
1709
1728
  }
1710
1729
  const state = refState.current;
1711
- if (state.ignoreScrollFromCalcTotal) {
1730
+ const newScroll = event.nativeEvent.contentOffset[horizontal ? "x" : "y"];
1731
+ if (state.ignoreScrollFromCalcTotal && newScroll !== 0) {
1712
1732
  return;
1713
1733
  }
1714
1734
  state.hasScrolled = true;
1715
1735
  state.lastBatchingAction = Date.now();
1716
1736
  const currentTime = performance.now();
1717
- const newScroll = event.nativeEvent.contentOffset[horizontal ? "x" : "y"];
1718
1737
  if (!(state.scrollHistory.length === 0 && newScroll === initialContentOffset)) {
1719
1738
  state.scrollHistory.push({ scroll: newScroll, time: currentTime });
1720
1739
  }
@@ -1744,7 +1763,7 @@ var LegendListInner = typedForwardRef(function LegendListInner2(props, forwarded
1744
1763
  checkAtBottom();
1745
1764
  checkAtTop();
1746
1765
  if (!fromSelf) {
1747
- onScrollProp == null ? void 0 : onScrollProp(event);
1766
+ (_d2 = state.onScroll) == null ? void 0 : _d2.call(state, event);
1748
1767
  }
1749
1768
  },
1750
1769
  []
@@ -1764,39 +1783,39 @@ var LegendListInner = typedForwardRef(function LegendListInner2(props, forwarded
1764
1783
  let firstIndexScrollPostion = firstIndexOffset - viewOffset;
1765
1784
  const diff = Math.abs(state.scroll - firstIndexScrollPostion);
1766
1785
  const needsReanchoring = maintainVisibleContentPosition && diff > 100;
1786
+ state.scrollForNextCalculateItemsInView = void 0;
1767
1787
  if (needsReanchoring) {
1768
1788
  const id = getId(index);
1769
1789
  state.anchorElement = { id, coordinate: firstIndexOffset };
1770
1790
  (_a2 = state.belowAnchorElementPositions) == null ? void 0 : _a2.clear();
1771
1791
  state.positions.clear();
1772
1792
  calcTotalSizesAndPositions({ forgetPositions: true });
1773
- state.scrollForNextCalculateItemsInView = void 0;
1774
1793
  state.startBufferedId = id;
1775
1794
  state.minIndexSizeChanged = index;
1776
1795
  firstIndexScrollPostion = firstIndexOffset - viewOffset + state.scrollAdjustHandler.getAppliedAdjust();
1777
1796
  }
1778
- state.scrollAdjustHandler.pauseAdjust();
1797
+ state.scrollAdjustHandler.setDisableAdjust(true);
1779
1798
  setTimeout(
1780
1799
  () => {
1781
- const wasAdjusted = state.scrollAdjustHandler.unPauseAdjust();
1782
- if (wasAdjusted) {
1783
- refState.current.scrollVelocity = 0;
1784
- refState.current.scrollHistory = [];
1785
- calculateItemsInView();
1786
- }
1800
+ state.scrollAdjustHandler.setDisableAdjust(false);
1801
+ calculateItemsInView();
1787
1802
  },
1788
- animated ? 1e3 : 50
1803
+ animated ? 150 : 50
1789
1804
  );
1790
1805
  if (viewPosition) {
1791
1806
  firstIndexScrollPostion -= viewPosition * (state.scrollLength - getItemSize(getId(index), index, state.data[index]));
1792
1807
  }
1793
1808
  const offset = horizontal ? { x: firstIndexScrollPostion, y: 0 } : { x: 0, y: firstIndexScrollPostion };
1794
- if (maintainVisibleContentPosition) {
1795
- setTimeout(() => {
1809
+ refScroller.current.scrollTo({ ...offset, animated });
1810
+ const totalSizeWithScrollAdjust = peek$(ctx, "totalSizeWithScrollAdjust");
1811
+ if (maintainVisibleContentPosition && totalSizeWithScrollAdjust - firstIndexScrollPostion < state.scrollLength) {
1812
+ const doScrollTo = () => {
1796
1813
  refScroller.current.scrollTo({ ...offset, animated });
1797
- }, 50);
1798
- } else {
1799
- refScroller.current.scrollTo({ ...offset, animated });
1814
+ };
1815
+ setTimeout(doScrollTo, animated ? 150 : 50);
1816
+ if (animated) {
1817
+ setTimeout(doScrollTo, 350);
1818
+ }
1800
1819
  }
1801
1820
  };
1802
1821
  return {
@@ -1821,6 +1840,42 @@ var LegendListInner = typedForwardRef(function LegendListInner2(props, forwarded
1821
1840
  },
1822
1841
  []
1823
1842
  );
1843
+ if (Platform.OS === "web") {
1844
+ useEffect(() => {
1845
+ var _a2, _b2;
1846
+ if (initialContentOffset) {
1847
+ (_a2 = refState.current) == null ? void 0 : _a2.scrollAdjustHandler.setDisableAdjust(true);
1848
+ (_b2 = refScroller.current) == null ? void 0 : _b2.scrollTo({
1849
+ x: horizontal ? initialContentOffset : 0,
1850
+ y: horizontal ? 0 : initialContentOffset,
1851
+ animated: false
1852
+ });
1853
+ setTimeout(() => {
1854
+ var _a3;
1855
+ (_a3 = refState.current) == null ? void 0 : _a3.scrollAdjustHandler.setDisableAdjust(false);
1856
+ }, 0);
1857
+ }
1858
+ }, []);
1859
+ }
1860
+ if (isFirst) {
1861
+ refState.current.scrollAdjustHandler.setDisableAdjust(true);
1862
+ }
1863
+ useEffect(() => {
1864
+ refState.current.scrollAdjustHandler.setDisableAdjust(false);
1865
+ if (initialContentOffset) {
1866
+ const doScrollTo = () => {
1867
+ var _a2;
1868
+ (_a2 = refScroller.current) == null ? void 0 : _a2.scrollTo({
1869
+ x: horizontal ? initialContentOffset : 0,
1870
+ y: horizontal ? 0 : initialContentOffset,
1871
+ animated: false
1872
+ });
1873
+ calculateItemsInView();
1874
+ };
1875
+ setTimeout(doScrollTo, 32);
1876
+ setTimeout(doScrollTo, 300);
1877
+ }
1878
+ }, []);
1824
1879
  return /* @__PURE__ */ React6.createElement(React6.Fragment, null, /* @__PURE__ */ React6.createElement(
1825
1880
  ListComponent,
1826
1881
  {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@legendapp/list",
3
- "version": "1.0.0-beta.25",
3
+ "version": "1.0.0-beta.27",
4
4
  "description": "Legend List aims to be a drop-in replacement for FlatList with much better performance and supporting dynamically sized items.",
5
5
  "sideEffects": false,
6
6
  "private": false,