Code review. Include the only 1 element condition to the carousel pager logic.
This commit is contained in:
parent
73d13ba37b
commit
959bdce13f
@ -143,7 +143,7 @@ open class Carousel: View {
|
||||
|
||||
// Check must be dispatched to main for the layout to complete in layoutCollection.
|
||||
DispatchQueue.main.async { [self] in
|
||||
let shouldHidePager = molecules?.isEmpty ?? true || collectionView.contentSize.width < bounds.width
|
||||
let shouldHidePager = molecules?.count ?? 0 < 2 || collectionView.contentSize.width < bounds.width
|
||||
if let pagingView = pagingView, shouldHidePager != pagingView.isHidden {
|
||||
pagingView.isHidden = shouldHidePager
|
||||
pagingBottomPin?.isActive = !shouldHidePager
|
||||
|
||||
Loading…
Reference in New Issue
Block a user