@legendapp/list 1.1.0 → 1.1.2

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/CHANGELOG.md CHANGED
@@ -1,3 +1,9 @@
1
+ ## 1.1.2
2
+ - Fix: Adding items in a list with item separators had a small layout jump as the previously last item re-rendered with a separator
3
+
4
+ ## 1.1.1
5
+ - Fix: scrollTo accuracy when paddingTop changes
6
+
1
7
  ## 1.1.0
2
8
  - Feat: Add LazyLegendList component for virtualizing regular children
3
9
  - Feat: Support initialScrollIndex with viewOffset and viewPosition
package/animated.d.mts CHANGED
@@ -3,7 +3,7 @@ import * as _legendapp_list from '@legendapp/list';
3
3
  import * as react_native from 'react-native';
4
4
  import { Animated } from 'react-native';
5
5
 
6
- declare const AnimatedLegendList: Animated.AnimatedComponent<(<T>(props: Omit<Omit<react_native.ScrollViewProps, "scrollEventThrottle">, "contentOffset" | "contentInset" | "maintainVisibleContentPosition" | "stickyHeaderIndices" | "removeClippedSubviews" | "children"> & {
6
+ declare const AnimatedLegendList: Animated.AnimatedComponent<(<T>(props: Omit<Omit<react_native.ScrollViewProps, "scrollEventThrottle">, "removeClippedSubviews" | "stickyHeaderIndices" | "children" | "contentInset" | "contentOffset" | "maintainVisibleContentPosition"> & {
7
7
  alignItemsAtEnd?: boolean;
8
8
  columnWrapperStyle?: _legendapp_list.ColumnWrapperStyle;
9
9
  data: readonly T[];
@@ -56,7 +56,7 @@ declare const AnimatedLegendList: Animated.AnimatedComponent<(<T>(props: Omit<Om
56
56
  recycleItems?: boolean;
57
57
  refScrollView?: React.Ref<react_native.ScrollView>;
58
58
  refreshing?: boolean;
59
- renderItem?: React$1.ComponentType<_legendapp_list.LegendListRenderItemProps<T>> | ((props: _legendapp_list.LegendListRenderItemProps<T>) => React$1.ReactNode) | undefined;
59
+ renderItem?: ((props: _legendapp_list.LegendListRenderItemProps<T>) => React$1.ReactNode) | React$1.ComponentType<_legendapp_list.LegendListRenderItemProps<T>> | undefined;
60
60
  renderScrollComponent?: (props: react_native.ScrollViewProps) => React.ReactElement<react_native.ScrollViewProps>;
61
61
  suggestEstimatedItemSize?: boolean;
62
62
  viewabilityConfig?: _legendapp_list.ViewabilityConfig;
package/animated.d.ts CHANGED
@@ -3,7 +3,7 @@ import * as _legendapp_list from '@legendapp/list';
3
3
  import * as react_native from 'react-native';
4
4
  import { Animated } from 'react-native';
5
5
 
6
- declare const AnimatedLegendList: Animated.AnimatedComponent<(<T>(props: Omit<Omit<react_native.ScrollViewProps, "scrollEventThrottle">, "contentOffset" | "contentInset" | "maintainVisibleContentPosition" | "stickyHeaderIndices" | "removeClippedSubviews" | "children"> & {
6
+ declare const AnimatedLegendList: Animated.AnimatedComponent<(<T>(props: Omit<Omit<react_native.ScrollViewProps, "scrollEventThrottle">, "removeClippedSubviews" | "stickyHeaderIndices" | "children" | "contentInset" | "contentOffset" | "maintainVisibleContentPosition"> & {
7
7
  alignItemsAtEnd?: boolean;
8
8
  columnWrapperStyle?: _legendapp_list.ColumnWrapperStyle;
9
9
  data: readonly T[];
@@ -56,7 +56,7 @@ declare const AnimatedLegendList: Animated.AnimatedComponent<(<T>(props: Omit<Om
56
56
  recycleItems?: boolean;
57
57
  refScrollView?: React.Ref<react_native.ScrollView>;
58
58
  refreshing?: boolean;
59
- renderItem?: React$1.ComponentType<_legendapp_list.LegendListRenderItemProps<T>> | ((props: _legendapp_list.LegendListRenderItemProps<T>) => React$1.ReactNode) | undefined;
59
+ renderItem?: ((props: _legendapp_list.LegendListRenderItemProps<T>) => React$1.ReactNode) | React$1.ComponentType<_legendapp_list.LegendListRenderItemProps<T>> | undefined;
60
60
  renderScrollComponent?: (props: react_native.ScrollViewProps) => React.ReactElement<react_native.ScrollViewProps>;
61
61
  suggestEstimatedItemSize?: boolean;
62
62
  viewabilityConfig?: _legendapp_list.ViewabilityConfig;
package/index.d.mts CHANGED
@@ -3,9 +3,9 @@ import { ComponentProps, ReactNode, Dispatch, SetStateAction } from 'react';
3
3
  import * as react_native from 'react-native';
4
4
  import { ScrollView, StyleProp, ViewStyle, ScrollViewProps, NativeSyntheticEvent, NativeScrollEvent, ScrollViewComponent, ScrollResponderMixin } from 'react-native';
5
5
  import Animated from 'react-native-reanimated';
6
- import * as _legendapp_list_reanimated from '@legendapp/list/reanimated';
7
6
  import * as _legendapp_list from '@legendapp/list';
8
- import { LegendListProps as LegendListProps$1, LegendListRenderItemProps as LegendListRenderItemProps$1, LegendListRef as LegendListRef$1 } from '@legendapp/list';
7
+ import { LegendListProps as LegendListProps$1, LegendListRef as LegendListRef$1, LegendListRenderItemProps as LegendListRenderItemProps$1 } from '@legendapp/list';
8
+ import * as _legendapp_list_reanimated from '@legendapp/list/reanimated';
9
9
 
10
10
  declare class ScrollAdjustHandler {
11
11
  private ctx;
@@ -499,7 +499,7 @@ type ScrollIndexWithOffsetPosition = {
499
499
  viewPosition?: number;
500
500
  };
501
501
 
502
- declare const LegendList: <T>(props: Omit<Omit<react_native.ScrollViewProps, "scrollEventThrottle">, "contentOffset" | "contentInset" | "maintainVisibleContentPosition" | "stickyHeaderIndices" | "removeClippedSubviews" | "children"> & {
502
+ declare const LegendList: <T>(props: Omit<Omit<react_native.ScrollViewProps, "scrollEventThrottle">, "removeClippedSubviews" | "stickyHeaderIndices" | "children" | "contentInset" | "contentOffset" | "maintainVisibleContentPosition"> & {
503
503
  alignItemsAtEnd?: boolean;
504
504
  columnWrapperStyle?: ColumnWrapperStyle;
505
505
  data: readonly T[];
@@ -552,7 +552,7 @@ declare const LegendList: <T>(props: Omit<Omit<react_native.ScrollViewProps, "sc
552
552
  recycleItems?: boolean;
553
553
  refScrollView?: React$1.Ref<ScrollView>;
554
554
  refreshing?: boolean;
555
- renderItem?: React$1.ComponentType<LegendListRenderItemProps<T>> | ((props: LegendListRenderItemProps<T>) => React$1.ReactNode) | undefined;
555
+ renderItem?: ((props: LegendListRenderItemProps<T>) => React$1.ReactNode) | React$1.ComponentType<LegendListRenderItemProps<T>> | undefined;
556
556
  renderScrollComponent?: (props: react_native.ScrollViewProps) => React$1.ReactElement<react_native.ScrollViewProps>;
557
557
  suggestEstimatedItemSize?: boolean;
558
558
  viewabilityConfig?: ViewabilityConfig;
@@ -567,7 +567,9 @@ interface LazyLegendListProps<ItemT, ListT> extends Omit<LegendListProps$1<ItemT
567
567
  children?: React$1.ReactNode | undefined;
568
568
  LegendList?: ListT;
569
569
  }
570
- declare const LazyLegendList: <ItemT, ListT extends (<T>(props: Omit<Omit<react_native.ScrollViewProps, "scrollEventThrottle">, "contentOffset" | "contentInset" | "maintainVisibleContentPosition" | "stickyHeaderIndices" | "removeClippedSubviews" | "children"> & {
570
+ declare const LazyLegendList: <ItemT, ListT extends (<ItemT_1>(props: _legendapp_list_reanimated.AnimatedLegendListProps<ItemT_1> & {
571
+ ref?: React$1.Ref<LegendListRef$1>;
572
+ }) => React$1.ReactElement | null) | (<T>(props: Omit<Omit<react_native.ScrollViewProps, "scrollEventThrottle">, "removeClippedSubviews" | "stickyHeaderIndices" | "children" | "contentInset" | "contentOffset" | "maintainVisibleContentPosition"> & {
571
573
  alignItemsAtEnd?: boolean;
572
574
  columnWrapperStyle?: _legendapp_list.ColumnWrapperStyle;
573
575
  data: readonly T[];
@@ -620,7 +622,7 @@ declare const LazyLegendList: <ItemT, ListT extends (<T>(props: Omit<Omit<react_
620
622
  recycleItems?: boolean;
621
623
  refScrollView?: React$1.Ref<react_native.ScrollView>;
622
624
  refreshing?: boolean;
623
- renderItem?: React$1.ComponentType<LegendListRenderItemProps$1<T>> | ((props: LegendListRenderItemProps$1<T>) => React$1.ReactNode) | undefined;
625
+ renderItem?: ((props: LegendListRenderItemProps$1<T>) => React$1.ReactNode) | React$1.ComponentType<LegendListRenderItemProps$1<T>> | undefined;
624
626
  renderScrollComponent?: (props: react_native.ScrollViewProps) => React$1.ReactElement<react_native.ScrollViewProps>;
625
627
  suggestEstimatedItemSize?: boolean;
626
628
  viewabilityConfig?: _legendapp_list.ViewabilityConfig;
@@ -629,7 +631,7 @@ declare const LazyLegendList: <ItemT, ListT extends (<T>(props: Omit<Omit<react_
629
631
  onLoad?: (info: {
630
632
  elapsedTimeInMs: number;
631
633
  }) => void;
632
- } & React$1.RefAttributes<LegendListRef$1>) => React$1.ReactNode) | react_native.Animated.AnimatedComponent<(<T>(props: Omit<Omit<react_native.ScrollViewProps, "scrollEventThrottle">, "contentOffset" | "contentInset" | "maintainVisibleContentPosition" | "stickyHeaderIndices" | "removeClippedSubviews" | "children"> & {
634
+ } & React$1.RefAttributes<LegendListRef$1>) => React$1.ReactNode) | react_native.Animated.AnimatedComponent<(<T>(props: Omit<Omit<react_native.ScrollViewProps, "scrollEventThrottle">, "removeClippedSubviews" | "stickyHeaderIndices" | "children" | "contentInset" | "contentOffset" | "maintainVisibleContentPosition"> & {
633
635
  alignItemsAtEnd?: boolean;
634
636
  columnWrapperStyle?: _legendapp_list.ColumnWrapperStyle;
635
637
  data: readonly T[];
@@ -682,7 +684,7 @@ declare const LazyLegendList: <ItemT, ListT extends (<T>(props: Omit<Omit<react_
682
684
  recycleItems?: boolean;
683
685
  refScrollView?: React$1.Ref<react_native.ScrollView>;
684
686
  refreshing?: boolean;
685
- renderItem?: React$1.ComponentType<LegendListRenderItemProps$1<T>> | ((props: LegendListRenderItemProps$1<T>) => React$1.ReactNode) | undefined;
687
+ renderItem?: ((props: LegendListRenderItemProps$1<T>) => React$1.ReactNode) | React$1.ComponentType<LegendListRenderItemProps$1<T>> | undefined;
686
688
  renderScrollComponent?: (props: react_native.ScrollViewProps) => React$1.ReactElement<react_native.ScrollViewProps>;
687
689
  suggestEstimatedItemSize?: boolean;
688
690
  viewabilityConfig?: _legendapp_list.ViewabilityConfig;
@@ -691,9 +693,7 @@ declare const LazyLegendList: <ItemT, ListT extends (<T>(props: Omit<Omit<react_
691
693
  onLoad?: (info: {
692
694
  elapsedTimeInMs: number;
693
695
  }) => void;
694
- } & React$1.RefAttributes<LegendListRef$1>) => React$1.ReactNode)> | (<ItemT_1>(props: _legendapp_list_reanimated.AnimatedLegendListProps<ItemT_1> & {
695
- ref?: React$1.Ref<LegendListRef$1>;
696
- }) => React$1.ReactElement | null) = <T>(props: Omit<Omit<react_native.ScrollViewProps, "scrollEventThrottle">, "contentOffset" | "contentInset" | "maintainVisibleContentPosition" | "stickyHeaderIndices" | "removeClippedSubviews" | "children"> & {
696
+ } & React$1.RefAttributes<LegendListRef$1>) => React$1.ReactNode)> = <T>(props: Omit<Omit<react_native.ScrollViewProps, "scrollEventThrottle">, "removeClippedSubviews" | "stickyHeaderIndices" | "children" | "contentInset" | "contentOffset" | "maintainVisibleContentPosition"> & {
697
697
  alignItemsAtEnd?: boolean;
698
698
  columnWrapperStyle?: _legendapp_list.ColumnWrapperStyle;
699
699
  data: readonly T[];
@@ -746,7 +746,7 @@ declare const LazyLegendList: <ItemT, ListT extends (<T>(props: Omit<Omit<react_
746
746
  recycleItems?: boolean;
747
747
  refScrollView?: React$1.Ref<react_native.ScrollView>;
748
748
  refreshing?: boolean;
749
- renderItem?: React$1.ComponentType<LegendListRenderItemProps$1<T>> | ((props: LegendListRenderItemProps$1<T>) => React$1.ReactNode) | undefined;
749
+ renderItem?: ((props: LegendListRenderItemProps$1<T>) => React$1.ReactNode) | React$1.ComponentType<LegendListRenderItemProps$1<T>> | undefined;
750
750
  renderScrollComponent?: (props: react_native.ScrollViewProps) => React$1.ReactElement<react_native.ScrollViewProps>;
751
751
  suggestEstimatedItemSize?: boolean;
752
752
  viewabilityConfig?: _legendapp_list.ViewabilityConfig;
package/index.d.ts CHANGED
@@ -3,9 +3,9 @@ import { ComponentProps, ReactNode, Dispatch, SetStateAction } from 'react';
3
3
  import * as react_native from 'react-native';
4
4
  import { ScrollView, StyleProp, ViewStyle, ScrollViewProps, NativeSyntheticEvent, NativeScrollEvent, ScrollViewComponent, ScrollResponderMixin } from 'react-native';
5
5
  import Animated from 'react-native-reanimated';
6
- import * as _legendapp_list_reanimated from '@legendapp/list/reanimated';
7
6
  import * as _legendapp_list from '@legendapp/list';
8
- import { LegendListProps as LegendListProps$1, LegendListRenderItemProps as LegendListRenderItemProps$1, LegendListRef as LegendListRef$1 } from '@legendapp/list';
7
+ import { LegendListProps as LegendListProps$1, LegendListRef as LegendListRef$1, LegendListRenderItemProps as LegendListRenderItemProps$1 } from '@legendapp/list';
8
+ import * as _legendapp_list_reanimated from '@legendapp/list/reanimated';
9
9
 
10
10
  declare class ScrollAdjustHandler {
11
11
  private ctx;
@@ -499,7 +499,7 @@ type ScrollIndexWithOffsetPosition = {
499
499
  viewPosition?: number;
500
500
  };
501
501
 
502
- declare const LegendList: <T>(props: Omit<Omit<react_native.ScrollViewProps, "scrollEventThrottle">, "contentOffset" | "contentInset" | "maintainVisibleContentPosition" | "stickyHeaderIndices" | "removeClippedSubviews" | "children"> & {
502
+ declare const LegendList: <T>(props: Omit<Omit<react_native.ScrollViewProps, "scrollEventThrottle">, "removeClippedSubviews" | "stickyHeaderIndices" | "children" | "contentInset" | "contentOffset" | "maintainVisibleContentPosition"> & {
503
503
  alignItemsAtEnd?: boolean;
504
504
  columnWrapperStyle?: ColumnWrapperStyle;
505
505
  data: readonly T[];
@@ -552,7 +552,7 @@ declare const LegendList: <T>(props: Omit<Omit<react_native.ScrollViewProps, "sc
552
552
  recycleItems?: boolean;
553
553
  refScrollView?: React$1.Ref<ScrollView>;
554
554
  refreshing?: boolean;
555
- renderItem?: React$1.ComponentType<LegendListRenderItemProps<T>> | ((props: LegendListRenderItemProps<T>) => React$1.ReactNode) | undefined;
555
+ renderItem?: ((props: LegendListRenderItemProps<T>) => React$1.ReactNode) | React$1.ComponentType<LegendListRenderItemProps<T>> | undefined;
556
556
  renderScrollComponent?: (props: react_native.ScrollViewProps) => React$1.ReactElement<react_native.ScrollViewProps>;
557
557
  suggestEstimatedItemSize?: boolean;
558
558
  viewabilityConfig?: ViewabilityConfig;
@@ -567,7 +567,9 @@ interface LazyLegendListProps<ItemT, ListT> extends Omit<LegendListProps$1<ItemT
567
567
  children?: React$1.ReactNode | undefined;
568
568
  LegendList?: ListT;
569
569
  }
570
- declare const LazyLegendList: <ItemT, ListT extends (<T>(props: Omit<Omit<react_native.ScrollViewProps, "scrollEventThrottle">, "contentOffset" | "contentInset" | "maintainVisibleContentPosition" | "stickyHeaderIndices" | "removeClippedSubviews" | "children"> & {
570
+ declare const LazyLegendList: <ItemT, ListT extends (<ItemT_1>(props: _legendapp_list_reanimated.AnimatedLegendListProps<ItemT_1> & {
571
+ ref?: React$1.Ref<LegendListRef$1>;
572
+ }) => React$1.ReactElement | null) | (<T>(props: Omit<Omit<react_native.ScrollViewProps, "scrollEventThrottle">, "removeClippedSubviews" | "stickyHeaderIndices" | "children" | "contentInset" | "contentOffset" | "maintainVisibleContentPosition"> & {
571
573
  alignItemsAtEnd?: boolean;
572
574
  columnWrapperStyle?: _legendapp_list.ColumnWrapperStyle;
573
575
  data: readonly T[];
@@ -620,7 +622,7 @@ declare const LazyLegendList: <ItemT, ListT extends (<T>(props: Omit<Omit<react_
620
622
  recycleItems?: boolean;
621
623
  refScrollView?: React$1.Ref<react_native.ScrollView>;
622
624
  refreshing?: boolean;
623
- renderItem?: React$1.ComponentType<LegendListRenderItemProps$1<T>> | ((props: LegendListRenderItemProps$1<T>) => React$1.ReactNode) | undefined;
625
+ renderItem?: ((props: LegendListRenderItemProps$1<T>) => React$1.ReactNode) | React$1.ComponentType<LegendListRenderItemProps$1<T>> | undefined;
624
626
  renderScrollComponent?: (props: react_native.ScrollViewProps) => React$1.ReactElement<react_native.ScrollViewProps>;
625
627
  suggestEstimatedItemSize?: boolean;
626
628
  viewabilityConfig?: _legendapp_list.ViewabilityConfig;
@@ -629,7 +631,7 @@ declare const LazyLegendList: <ItemT, ListT extends (<T>(props: Omit<Omit<react_
629
631
  onLoad?: (info: {
630
632
  elapsedTimeInMs: number;
631
633
  }) => void;
632
- } & React$1.RefAttributes<LegendListRef$1>) => React$1.ReactNode) | react_native.Animated.AnimatedComponent<(<T>(props: Omit<Omit<react_native.ScrollViewProps, "scrollEventThrottle">, "contentOffset" | "contentInset" | "maintainVisibleContentPosition" | "stickyHeaderIndices" | "removeClippedSubviews" | "children"> & {
634
+ } & React$1.RefAttributes<LegendListRef$1>) => React$1.ReactNode) | react_native.Animated.AnimatedComponent<(<T>(props: Omit<Omit<react_native.ScrollViewProps, "scrollEventThrottle">, "removeClippedSubviews" | "stickyHeaderIndices" | "children" | "contentInset" | "contentOffset" | "maintainVisibleContentPosition"> & {
633
635
  alignItemsAtEnd?: boolean;
634
636
  columnWrapperStyle?: _legendapp_list.ColumnWrapperStyle;
635
637
  data: readonly T[];
@@ -682,7 +684,7 @@ declare const LazyLegendList: <ItemT, ListT extends (<T>(props: Omit<Omit<react_
682
684
  recycleItems?: boolean;
683
685
  refScrollView?: React$1.Ref<react_native.ScrollView>;
684
686
  refreshing?: boolean;
685
- renderItem?: React$1.ComponentType<LegendListRenderItemProps$1<T>> | ((props: LegendListRenderItemProps$1<T>) => React$1.ReactNode) | undefined;
687
+ renderItem?: ((props: LegendListRenderItemProps$1<T>) => React$1.ReactNode) | React$1.ComponentType<LegendListRenderItemProps$1<T>> | undefined;
686
688
  renderScrollComponent?: (props: react_native.ScrollViewProps) => React$1.ReactElement<react_native.ScrollViewProps>;
687
689
  suggestEstimatedItemSize?: boolean;
688
690
  viewabilityConfig?: _legendapp_list.ViewabilityConfig;
@@ -691,9 +693,7 @@ declare const LazyLegendList: <ItemT, ListT extends (<T>(props: Omit<Omit<react_
691
693
  onLoad?: (info: {
692
694
  elapsedTimeInMs: number;
693
695
  }) => void;
694
- } & React$1.RefAttributes<LegendListRef$1>) => React$1.ReactNode)> | (<ItemT_1>(props: _legendapp_list_reanimated.AnimatedLegendListProps<ItemT_1> & {
695
- ref?: React$1.Ref<LegendListRef$1>;
696
- }) => React$1.ReactElement | null) = <T>(props: Omit<Omit<react_native.ScrollViewProps, "scrollEventThrottle">, "contentOffset" | "contentInset" | "maintainVisibleContentPosition" | "stickyHeaderIndices" | "removeClippedSubviews" | "children"> & {
696
+ } & React$1.RefAttributes<LegendListRef$1>) => React$1.ReactNode)> = <T>(props: Omit<Omit<react_native.ScrollViewProps, "scrollEventThrottle">, "removeClippedSubviews" | "stickyHeaderIndices" | "children" | "contentInset" | "contentOffset" | "maintainVisibleContentPosition"> & {
697
697
  alignItemsAtEnd?: boolean;
698
698
  columnWrapperStyle?: _legendapp_list.ColumnWrapperStyle;
699
699
  data: readonly T[];
@@ -746,7 +746,7 @@ declare const LazyLegendList: <ItemT, ListT extends (<T>(props: Omit<Omit<react_
746
746
  recycleItems?: boolean;
747
747
  refScrollView?: React$1.Ref<react_native.ScrollView>;
748
748
  refreshing?: boolean;
749
- renderItem?: React$1.ComponentType<LegendListRenderItemProps$1<T>> | ((props: LegendListRenderItemProps$1<T>) => React$1.ReactNode) | undefined;
749
+ renderItem?: ((props: LegendListRenderItemProps$1<T>) => React$1.ReactNode) | React$1.ComponentType<LegendListRenderItemProps$1<T>> | undefined;
750
750
  renderScrollComponent?: (props: react_native.ScrollViewProps) => React$1.ReactElement<react_native.ScrollViewProps>;
751
751
  suggestEstimatedItemSize?: boolean;
752
752
  viewabilityConfig?: _legendapp_list.ViewabilityConfig;
package/index.js CHANGED
@@ -376,17 +376,18 @@ var Container = ({
376
376
  const [layoutRenderCount, forceLayoutRender] = React2.useState(0);
377
377
  const otherAxisPos = numColumns > 1 ? `${(column - 1) / numColumns * 100}%` : 0;
378
378
  const otherAxisSize = numColumns > 1 ? `${1 / numColumns * 100}%` : void 0;
379
+ const isALastItem = lastItemKeys.includes(itemKey);
379
380
  let paddingStyles;
380
381
  if (columnWrapperStyle) {
381
382
  const { columnGap, rowGap, gap } = columnWrapperStyle;
382
383
  if (horizontal) {
383
384
  paddingStyles = {
384
- paddingRight: !lastItemKeys.includes(itemKey) ? columnGap || gap || void 0 : void 0,
385
+ paddingRight: !isALastItem ? columnGap || gap || void 0 : void 0,
385
386
  paddingVertical: numColumns > 1 ? (rowGap || gap || 0) / 2 : void 0
386
387
  };
387
388
  } else {
388
389
  paddingStyles = {
389
- paddingBottom: !lastItemKeys.includes(itemKey) ? rowGap || gap || void 0 : void 0,
390
+ paddingBottom: !isALastItem ? rowGap || gap || void 0 : void 0,
390
391
  paddingHorizontal: numColumns > 1 ? (columnGap || gap || 0) / 2 : void 0
391
392
  };
392
393
  }
@@ -445,7 +446,7 @@ var Container = ({
445
446
  }
446
447
  }
447
448
  }
448
- }, [itemKey, layoutRenderCount]);
449
+ }, [itemKey, layoutRenderCount, isALastItem]);
449
450
  } else {
450
451
  React2.useEffect(() => {
451
452
  if (!isNullOrUndefined(itemKey)) {
@@ -464,7 +465,7 @@ var Container = ({
464
465
  ctx.viewRefs.set(id, ref);
465
466
  return { containerId: id, itemKey, index, value: data, triggerLayout };
466
467
  }, [id, itemKey, index, data]);
467
- const contentFragment = /* @__PURE__ */ React2__namespace.default.createElement(React2__namespace.default.Fragment, { key: recycleItems ? void 0 : itemKey }, /* @__PURE__ */ React2__namespace.default.createElement(ContextContainer.Provider, { value: contextValue }, renderedItem, renderedItemInfo && ItemSeparatorComponent && !lastItemKeys.includes(itemKey) && /* @__PURE__ */ React2__namespace.default.createElement(ItemSeparatorComponent, { leadingItem: renderedItemInfo.item })));
468
+ const contentFragment = /* @__PURE__ */ React2__namespace.default.createElement(React2__namespace.default.Fragment, { key: recycleItems ? void 0 : itemKey }, /* @__PURE__ */ React2__namespace.default.createElement(ContextContainer.Provider, { value: contextValue }, renderedItem, renderedItemInfo && ItemSeparatorComponent && !isALastItem && /* @__PURE__ */ React2__namespace.default.createElement(ItemSeparatorComponent, { leadingItem: renderedItemInfo.item })));
468
469
  if (maintainVisibleContentPosition) {
469
470
  const anchorStyle = horizontal ? position.type === "top" ? { position: "absolute", left: 0, top: 0, bottom: 0, flexDirection: "row", alignItems: "stretch" } : { position: "absolute", right: 0, top: 0, bottom: 0, flexDirection: "row", alignItems: "stretch" } : position.type === "top" ? { position: "absolute", top: 0, left: 0, right: 0 } : { position: "absolute", bottom: 0, left: 0, right: 0 };
470
471
  if (__DEV__ && ENABLE_DEVMODE) {
@@ -1786,6 +1787,7 @@ var LegendListInner = typedForwardRef(function LegendListInner2(props, forwarded
1786
1787
  state.scrollAdjustHandler.setDisableAdjust(true);
1787
1788
  state.scrollHistory.length = 0;
1788
1789
  state.scrollingTo = params;
1790
+ state.scrollPending = offset;
1789
1791
  (_a = refScroller.current) == null ? void 0 : _a.scrollTo({
1790
1792
  x: horizontal ? offset : 0,
1791
1793
  y: horizontal ? 0 : offset,
@@ -2092,7 +2094,7 @@ var LegendListInner = typedForwardRef(function LegendListInner2(props, forwarded
2092
2094
  const paddingDiff = stylePaddingTopState - prevPaddingTop;
2093
2095
  if (paddingDiff && prevPaddingTop !== void 0 && reactNative.Platform.OS === "ios") {
2094
2096
  queueMicrotask(() => {
2095
- scrollTo({ offset: refState.current.scroll + paddingDiff, animated: false });
2097
+ scrollTo({ offset: refState.current.scrollPending + paddingDiff, animated: false });
2096
2098
  });
2097
2099
  }
2098
2100
  };
@@ -2591,7 +2593,6 @@ var LazyLegendList = typedForwardRef2(function LazyLegendList2(props, forwardedR
2591
2593
  const { LegendList: LegendListProp, children, ...rest } = props;
2592
2594
  const LegendListComponent = LegendListProp != null ? LegendListProp : list.LegendList;
2593
2595
  const data = (isArray(children) ? children : React2__namespace.Children.toArray(children)).flat(1);
2594
- console.log({ data });
2595
2596
  return (
2596
2597
  // @ts-expect-error TODO: Fix this type
2597
2598
  /* @__PURE__ */ React2__namespace.createElement(LegendListComponent, { ...rest, data, renderItem, ref: forwardedRef })
package/index.mjs CHANGED
@@ -355,17 +355,18 @@ var Container = ({
355
355
  const [layoutRenderCount, forceLayoutRender] = useState(0);
356
356
  const otherAxisPos = numColumns > 1 ? `${(column - 1) / numColumns * 100}%` : 0;
357
357
  const otherAxisSize = numColumns > 1 ? `${1 / numColumns * 100}%` : void 0;
358
+ const isALastItem = lastItemKeys.includes(itemKey);
358
359
  let paddingStyles;
359
360
  if (columnWrapperStyle) {
360
361
  const { columnGap, rowGap, gap } = columnWrapperStyle;
361
362
  if (horizontal) {
362
363
  paddingStyles = {
363
- paddingRight: !lastItemKeys.includes(itemKey) ? columnGap || gap || void 0 : void 0,
364
+ paddingRight: !isALastItem ? columnGap || gap || void 0 : void 0,
364
365
  paddingVertical: numColumns > 1 ? (rowGap || gap || 0) / 2 : void 0
365
366
  };
366
367
  } else {
367
368
  paddingStyles = {
368
- paddingBottom: !lastItemKeys.includes(itemKey) ? rowGap || gap || void 0 : void 0,
369
+ paddingBottom: !isALastItem ? rowGap || gap || void 0 : void 0,
369
370
  paddingHorizontal: numColumns > 1 ? (columnGap || gap || 0) / 2 : void 0
370
371
  };
371
372
  }
@@ -424,7 +425,7 @@ var Container = ({
424
425
  }
425
426
  }
426
427
  }
427
- }, [itemKey, layoutRenderCount]);
428
+ }, [itemKey, layoutRenderCount, isALastItem]);
428
429
  } else {
429
430
  useEffect(() => {
430
431
  if (!isNullOrUndefined(itemKey)) {
@@ -443,7 +444,7 @@ var Container = ({
443
444
  ctx.viewRefs.set(id, ref);
444
445
  return { containerId: id, itemKey, index, value: data, triggerLayout };
445
446
  }, [id, itemKey, index, data]);
446
- const contentFragment = /* @__PURE__ */ React2__default.createElement(React2__default.Fragment, { key: recycleItems ? void 0 : itemKey }, /* @__PURE__ */ React2__default.createElement(ContextContainer.Provider, { value: contextValue }, renderedItem, renderedItemInfo && ItemSeparatorComponent && !lastItemKeys.includes(itemKey) && /* @__PURE__ */ React2__default.createElement(ItemSeparatorComponent, { leadingItem: renderedItemInfo.item })));
447
+ const contentFragment = /* @__PURE__ */ React2__default.createElement(React2__default.Fragment, { key: recycleItems ? void 0 : itemKey }, /* @__PURE__ */ React2__default.createElement(ContextContainer.Provider, { value: contextValue }, renderedItem, renderedItemInfo && ItemSeparatorComponent && !isALastItem && /* @__PURE__ */ React2__default.createElement(ItemSeparatorComponent, { leadingItem: renderedItemInfo.item })));
447
448
  if (maintainVisibleContentPosition) {
448
449
  const anchorStyle = horizontal ? position.type === "top" ? { position: "absolute", left: 0, top: 0, bottom: 0, flexDirection: "row", alignItems: "stretch" } : { position: "absolute", right: 0, top: 0, bottom: 0, flexDirection: "row", alignItems: "stretch" } : position.type === "top" ? { position: "absolute", top: 0, left: 0, right: 0 } : { position: "absolute", bottom: 0, left: 0, right: 0 };
449
450
  if (__DEV__ && ENABLE_DEVMODE) {
@@ -1765,6 +1766,7 @@ var LegendListInner = typedForwardRef(function LegendListInner2(props, forwarded
1765
1766
  state.scrollAdjustHandler.setDisableAdjust(true);
1766
1767
  state.scrollHistory.length = 0;
1767
1768
  state.scrollingTo = params;
1769
+ state.scrollPending = offset;
1768
1770
  (_a = refScroller.current) == null ? void 0 : _a.scrollTo({
1769
1771
  x: horizontal ? offset : 0,
1770
1772
  y: horizontal ? 0 : offset,
@@ -2071,7 +2073,7 @@ var LegendListInner = typedForwardRef(function LegendListInner2(props, forwarded
2071
2073
  const paddingDiff = stylePaddingTopState - prevPaddingTop;
2072
2074
  if (paddingDiff && prevPaddingTop !== void 0 && Platform.OS === "ios") {
2073
2075
  queueMicrotask(() => {
2074
- scrollTo({ offset: refState.current.scroll + paddingDiff, animated: false });
2076
+ scrollTo({ offset: refState.current.scrollPending + paddingDiff, animated: false });
2075
2077
  });
2076
2078
  }
2077
2079
  };
@@ -2570,7 +2572,6 @@ var LazyLegendList = typedForwardRef2(function LazyLegendList2(props, forwardedR
2570
2572
  const { LegendList: LegendListProp, children, ...rest } = props;
2571
2573
  const LegendListComponent = LegendListProp != null ? LegendListProp : LegendList$1;
2572
2574
  const data = (isArray(children) ? children : React2.Children.toArray(children)).flat(1);
2573
- console.log({ data });
2574
2575
  return (
2575
2576
  // @ts-expect-error TODO: Fix this type
2576
2577
  /* @__PURE__ */ React2.createElement(LegendListComponent, { ...rest, data, renderItem, ref: forwardedRef })
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@legendapp/list",
3
- "version": "1.1.0",
3
+ "version": "1.1.2",
4
4
  "description": "Legend List is a drop-in replacement for FlatList with much better performance and supporting dynamically sized items.",
5
5
  "sideEffects": false,
6
6
  "private": false,