Fix for showing pagingView when itemWidthPercent is less than 100

This commit is contained in:
Nandhini Rajendran 2024-09-13 17:02:21 +05:30
parent 1b5ca94988
commit ad7bf0dad6

View File

@ -111,7 +111,7 @@ 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
let shouldHidePager = ((molecules?.count ?? 0) < 2) && (collectionView.contentSize.width < bounds.width)
if (shouldHidePager && !pagingView.isHidden) || (!shouldHidePager && pagingView.isHidden) {
pagingView.isHidden = shouldHidePager
pagingBottomPin?.isActive = !shouldHidePager