@asdp/ferryui 0.1.22-dev.9319 → 0.1.22-dev.9336

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/dist/index.js CHANGED
@@ -648,10 +648,9 @@ var CarouselWithCustomNav = ({
648
648
  }),
649
649
  [language, customLabels, deprecatedAriaLabel]
650
650
  );
651
- const activeIndex = isSingleSlide ? 0 : controlledIndex !== void 0 ? controlledIndex : internalIndex;
651
+ const activeIndex = controlledIndex !== void 0 ? controlledIndex : internalIndex;
652
652
  const handleIndexChange = React.useCallback(
653
653
  (index) => {
654
- if (isSingleSlide) return;
655
654
  if (controlledIndex === void 0) {
656
655
  setInternalIndex(index);
657
656
  }
@@ -660,10 +659,11 @@ var CarouselWithCustomNav = ({
660
659
  [controlledIndex, onActiveIndexChange, isSingleSlide]
661
660
  );
662
661
  React__default.default.useEffect(() => {
663
- if (!autoPlay || isSingleSlide) return;
662
+ if (!autoPlay) return;
663
+ const effectiveTotalSlides = isSingleSlide ? 2 : totalSlides;
664
664
  const intervalId = setInterval(() => {
665
665
  let nextIndex = activeIndex + 1;
666
- if (nextIndex >= totalSlides) {
666
+ if (nextIndex >= effectiveTotalSlides) {
667
667
  nextIndex = circular ? 0 : activeIndex;
668
668
  }
669
669
  if (nextIndex !== activeIndex) {