diff --git a/MVMCoreUI/Atomic/Organisms/Carousel/Carousel.swift b/MVMCoreUI/Atomic/Organisms/Carousel/Carousel.swift index 58ad2280..03480a1c 100644 --- a/MVMCoreUI/Atomic/Organisms/Carousel/Carousel.swift +++ b/MVMCoreUI/Atomic/Organisms/Carousel/Carousel.swift @@ -111,7 +111,9 @@ open class Carousel: View { /// Updates if the pager is visible or not. private func updatePagerVisibility() { guard let pagingView = pagingView else { return } - let shouldHidePager = collectionView.contentSize.width < bounds.width + // Consider hidesForSinglePage only if numberOfPages is less than 2 + let hidePager = (numberOfPages < 2) ? ((pagingView.model as? CarouselPagingModelProtocol)?.hidesForSinglePage ?? true) : false + let shouldHidePager = (collectionView.contentSize.width < bounds.width) && hidePager if (shouldHidePager && !pagingView.isHidden) || (!shouldHidePager && pagingView.isHidden) { pagingView.isHidden = shouldHidePager pagingBottomPin?.isActive = !shouldHidePager @@ -491,6 +493,7 @@ extension Carousel: UICollectionViewDelegate { adjustedIndex = adjustedIndex + numberOfPages } model.selectedIndex = adjustedIndex + pagingView?.currentIndex = adjustedIndex } if let cell = collectionView.cellForItem(at: indexPath) as? CollectionTemplateItemProtocol { cell.didSelectCell(at: indexPath, delegateObject: delegateObject, additionalData: nil)