fermoya / SwiftUIPager

Native Pager in SwiftUI
MIT License
1.27k stars 166 forks source link

[BUG] Cannot navigate through pages using VoiceOver #296

Open KostiantynDA opened 1 year ago

KostiantynDA commented 1 year ago

Cannot navigate through pages using VoiceOver

To Reproduce Turn on VoiceOver and try to change a page

Expected behavior Pager should scroll to the next and previous items

Screenshots / Videos https://user-images.githubusercontent.com/108671935/187481711-14884d66-5c20-4c89-921f-3dfd220e281b.mov

Environment:

sdavidliu commented 1 year ago

+1 on this, it would be great for our VoiceOver users

aechaves commented 1 year ago

To scroll using single finger swipe up/down during voice over focus, I had to add this modifier to the Pager component:

EDIT: Does not seem to be triggering the onPageChanged event

.accessibilityAdjustableAction({ direction in
    switch direction {
    case .increment:
        withAnimation {
            page.update(.next)
        }
        break
    case .decrement:
        withAnimation {
            page.update(.previous)
        }
        break
    @unknown default:
        break
    }

})