@r0b0t3d/react-native-carousel 3.4.7 → 3.4.8

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@r0b0t3d/react-native-carousel",
3
- "version": "3.4.7",
3
+ "version": "3.4.8",
4
4
  "description": "React Native Carousel",
5
5
  "main": "lib/commonjs/index",
6
6
  "module": "lib/module/index",
@@ -31,11 +31,13 @@ import { useInternalCarouselContext } from './useInternalCarouselContext';
31
31
  // Transitions:
32
32
  //
33
33
  // IDLE ── onBeginDrag ──► DRAGGING
34
+ // IDLE ── programmatic scroll ──► (stays IDLE, onMomentumEnd fires)
34
35
  // DRAGGING ── onMomentumEnd ──► IDLE (or LOOP_JUMP at boundary)
35
36
  // LOOP_JUMP ── onScroll (arrival) ──► IDLE
36
37
  // LOOP_JUMP ── onBeginDrag (user overrides) ──► DRAGGING
37
38
  //
38
- // Page change (onPageChange / animatedPage) only fires at IDLE transitions.
39
+ // Page change (onPageChange / animatedPage) fires from onMomentumEnd for
40
+ // both user drags and programmatic scrolls (goNext / goPrev / snapToItem).
39
41
  // Autoplay only advances when state === IDLE.
40
42
  // ---------------------------------------------------------------------------
41
43
 
@@ -352,9 +354,10 @@ function Carousel<TData>({
352
354
  },
353
355
 
354
356
  onMomentumEnd: (event) => {
355
- // Only process page changes when dragging ended naturally.
356
- // Loop jumps are handled in onScroll.
357
- if (carouselState.value !== CarouselState.DRAGGING) {
357
+ // Process page changes after both user drags and programmatic
358
+ // scrolls (goNext / goPrev / snapToItem). Loop jumps are
359
+ // instant scrolls that are resolved via onScroll instead.
360
+ if (carouselState.value === CarouselState.LOOP_JUMP) {
358
361
  return;
359
362
  }
360
363