Skip to content

Commit bd618a8

Browse files
committed
Fix oversight
1 parent 338d16d commit bd618a8

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

Sources/Navigator/DirectionalNavigationAdapter.swift

+4
Original file line numberDiff line numberDiff line change
@@ -125,6 +125,10 @@ public final class DirectionalNavigationAdapter {
125125
/// It will automatically observe pointer and key events to turn pages.
126126
@MainActor public func bind(to navigator: VisualNavigator) {
127127
for pointerType in PointerType.allCases {
128+
guard pointerPolicy.types.contains(pointerType) else {
129+
continue
130+
}
131+
128132
switch pointerType {
129133
case .touch:
130134
navigator.addObserver(.tap { [self, weak navigator] event in

TestApp/Sources/Reader/Common/VisualReaderViewController.swift

+1-1
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ class VisualReaderViewController<N: UIViewController & Navigator>: ReaderViewCon
8282
/// Bind it to the navigator before adding your own observers to prevent
8383
/// triggering your actions when turning pages.
8484
DirectionalNavigationAdapter(
85-
pointerPolicy: .init(types: [.mouse, .touch]),
85+
pointerPolicy: .init(types: [.mouse, .touch])
8686
).bind(to: navigator)
8787

8888
// Clear the current search highlight on tap.

0 commit comments

Comments
 (0)