@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
|
@@ -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)
|
|
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
|
-
//
|
|
356
|
-
//
|
|
357
|
-
|
|
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
|
|