Skip to content

Commit

Permalink
Update Pager.swift
Browse files Browse the repository at this point in the history
  • Loading branch information
peterpaulis authored Oct 4, 2023
1 parent ea8f0dc commit bc33345
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions Sources/SwiftUIPager/Pager.swift
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,9 @@ public struct Pager<Element, ID, PageView>: View where PageView: View, Element:
/// `true` if `Pager` can be dragged
var allowsDragging: Bool = true

/// `true` if `Pager` can be controlled by the keyboard commands
var allowsKeyboardControl: Bool = true

/// `true` if `Pager`interacts with the digital crown
var allowsDigitalCrownRotation: Bool = true

Expand Down Expand Up @@ -215,7 +218,8 @@ public struct Pager<Element, ID, PageView>: View where PageView: View, Element:
.padding(sideInsets)
.pagingAnimation(pagingAnimation)
.partialPagination(pageRatio)

.allowsKeyboardControl(allowsKeyboardControl)

#if !os(tvOS)
pagerContent = pagerContent
.swipeInteractionArea(swipeInteractionArea)
Expand Down Expand Up @@ -245,7 +249,7 @@ public struct Pager<Element, ID, PageView>: View where PageView: View, Element:
pagerContent = isHorizontal ? pagerContent.horizontal(horizontalSwipeDirection) : pagerContent.vertical(verticalSwipeDirection)

if let preferredItemSize = preferredItemSize {
pagerContent = pagerContent.preferredItemSize(preferredItemSize, alignment: itemAlignment)
pagerContent = pagerContent.preferredItemSize(preferredItemSize)
}

return pagerContent
Expand Down

0 comments on commit bc33345

Please sign in to comment.