@legendapp/list 1.1.0 → 1.1.1

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,6 @@
1
+ ## 1.1.1
2
+ - Fix: scrollTo accuracy when paddingTop changes
3
+
1
4
  ## 1.1.0
2
5
  - Feat: Add LazyLegendList component for virtualizing regular children
3
6
  - Feat: Support initialScrollIndex with viewOffset and viewPosition
package/index.js CHANGED
@@ -1786,6 +1786,7 @@ var LegendListInner = typedForwardRef(function LegendListInner2(props, forwarded
1786
1786
  state.scrollAdjustHandler.setDisableAdjust(true);
1787
1787
  state.scrollHistory.length = 0;
1788
1788
  state.scrollingTo = params;
1789
+ state.scrollPending = offset;
1789
1790
  (_a = refScroller.current) == null ? void 0 : _a.scrollTo({
1790
1791
  x: horizontal ? offset : 0,
1791
1792
  y: horizontal ? 0 : offset,
@@ -2092,7 +2093,7 @@ var LegendListInner = typedForwardRef(function LegendListInner2(props, forwarded
2092
2093
  const paddingDiff = stylePaddingTopState - prevPaddingTop;
2093
2094
  if (paddingDiff && prevPaddingTop !== void 0 && reactNative.Platform.OS === "ios") {
2094
2095
  queueMicrotask(() => {
2095
- scrollTo({ offset: refState.current.scroll + paddingDiff, animated: false });
2096
+ scrollTo({ offset: refState.current.scrollPending + paddingDiff, animated: false });
2096
2097
  });
2097
2098
  }
2098
2099
  };
package/index.mjs CHANGED
@@ -1765,6 +1765,7 @@ var LegendListInner = typedForwardRef(function LegendListInner2(props, forwarded
1765
1765
  state.scrollAdjustHandler.setDisableAdjust(true);
1766
1766
  state.scrollHistory.length = 0;
1767
1767
  state.scrollingTo = params;
1768
+ state.scrollPending = offset;
1768
1769
  (_a = refScroller.current) == null ? void 0 : _a.scrollTo({
1769
1770
  x: horizontal ? offset : 0,
1770
1771
  y: horizontal ? 0 : offset,
@@ -2071,7 +2072,7 @@ var LegendListInner = typedForwardRef(function LegendListInner2(props, forwarded
2071
2072
  const paddingDiff = stylePaddingTopState - prevPaddingTop;
2072
2073
  if (paddingDiff && prevPaddingTop !== void 0 && Platform.OS === "ios") {
2073
2074
  queueMicrotask(() => {
2074
- scrollTo({ offset: refState.current.scroll + paddingDiff, animated: false });
2075
+ scrollTo({ offset: refState.current.scrollPending + paddingDiff, animated: false });
2075
2076
  });
2076
2077
  }
2077
2078
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@legendapp/list",
3
- "version": "1.1.0",
3
+ "version": "1.1.1",
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,
package/.DS_Store DELETED
Binary file