@legendapp/list 2.0.0-beta.6 → 2.0.0-beta.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.
Files changed (3) hide show
  1. package/index.js +4 -3
  2. package/index.mjs +4 -3
  3. package/package.json +1 -1
package/index.js CHANGED
@@ -288,17 +288,17 @@ var PositionViewSticky = typedMemo(function PositionViewSticky2({
288
288
  index,
289
289
  ...rest
290
290
  }) {
291
- const [position = POSITION_OUT_OF_VIEW] = useArr$([`containerPosition${id}`]);
291
+ const [position = POSITION_OUT_OF_VIEW, headerSize] = useArr$([`containerPosition${id}`, "headerSize"]);
292
292
  const transform = React3__namespace.useMemo(() => {
293
293
  if (animatedScrollY && stickyOffset) {
294
294
  const stickyPosition = animatedScrollY.interpolate({
295
295
  extrapolate: "clamp",
296
- inputRange: [position, position + 5e3],
296
+ inputRange: [position + headerSize, position + 5e3 + headerSize],
297
297
  outputRange: [position, position + 5e3]
298
298
  });
299
299
  return horizontal ? [{ translateX: stickyPosition }] : [{ translateY: stickyPosition }];
300
300
  }
301
- }, [position, horizontal, animatedScrollY, stickyOffset]);
301
+ }, [animatedScrollY, headerSize, horizontal, stickyOffset, position]);
302
302
  const viewStyle = React3__namespace.useMemo(() => [style, { zIndex: index + 1e3 }, { transform }], [style, transform]);
303
303
  return /* @__PURE__ */ React3__namespace.createElement(reactNative.Animated.View, { ref: refView, style: viewStyle, ...rest });
304
304
  });
@@ -2031,6 +2031,7 @@ function calculateItemsInView(ctx, state, params = {}) {
2031
2031
  set$(ctx, `containerStickyOffset${containerIndex}`, new reactNative.Animated.Value(topPadding));
2032
2032
  state.stickyContainerPool.add(containerIndex);
2033
2033
  } else {
2034
+ set$(ctx, `containerSticky${containerIndex}`, false);
2034
2035
  state.stickyContainerPool.delete(containerIndex);
2035
2036
  }
2036
2037
  if (containerIndex >= numContainers2) {
package/index.mjs CHANGED
@@ -267,17 +267,17 @@ var PositionViewSticky = typedMemo(function PositionViewSticky2({
267
267
  index,
268
268
  ...rest
269
269
  }) {
270
- const [position = POSITION_OUT_OF_VIEW] = useArr$([`containerPosition${id}`]);
270
+ const [position = POSITION_OUT_OF_VIEW, headerSize] = useArr$([`containerPosition${id}`, "headerSize"]);
271
271
  const transform = React3.useMemo(() => {
272
272
  if (animatedScrollY && stickyOffset) {
273
273
  const stickyPosition = animatedScrollY.interpolate({
274
274
  extrapolate: "clamp",
275
- inputRange: [position, position + 5e3],
275
+ inputRange: [position + headerSize, position + 5e3 + headerSize],
276
276
  outputRange: [position, position + 5e3]
277
277
  });
278
278
  return horizontal ? [{ translateX: stickyPosition }] : [{ translateY: stickyPosition }];
279
279
  }
280
- }, [position, horizontal, animatedScrollY, stickyOffset]);
280
+ }, [animatedScrollY, headerSize, horizontal, stickyOffset, position]);
281
281
  const viewStyle = React3.useMemo(() => [style, { zIndex: index + 1e3 }, { transform }], [style, transform]);
282
282
  return /* @__PURE__ */ React3.createElement(Animated.View, { ref: refView, style: viewStyle, ...rest });
283
283
  });
@@ -2010,6 +2010,7 @@ function calculateItemsInView(ctx, state, params = {}) {
2010
2010
  set$(ctx, `containerStickyOffset${containerIndex}`, new Animated.Value(topPadding));
2011
2011
  state.stickyContainerPool.add(containerIndex);
2012
2012
  } else {
2013
+ set$(ctx, `containerSticky${containerIndex}`, false);
2013
2014
  state.stickyContainerPool.delete(containerIndex);
2014
2015
  }
2015
2016
  if (containerIndex >= numContainers2) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@legendapp/list",
3
- "version": "2.0.0-beta.6",
3
+ "version": "2.0.0-beta.7",
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,