diff --git a/BrowserKit/Sources/OnboardingKit/Views/Regular/OnboardingViewRegular.swift b/BrowserKit/Sources/OnboardingKit/Views/Regular/OnboardingViewRegular.swift index 76eebdc9bdbf6..e8ae1c124a802 100644 --- a/BrowserKit/Sources/OnboardingKit/Views/Regular/OnboardingViewRegular.swift +++ b/BrowserKit/Sources/OnboardingKit/Views/Regular/OnboardingViewRegular.swift @@ -38,6 +38,9 @@ struct OnboardingViewRegular: Themea } .cardBackground(theme: theme, cornerRadius: UX.CardView.cornerRadius) } + .accessibilityScrollAction { edge in + handleAccessibilityScroll(from: edge) + } Button(action: viewModel.skipOnboarding) { Text(viewModel.skipText) .font(FXFontStyles.Bold.body.scaledSwiftUIFont(sizeCap: UX.Onboarding.Font.skipButtonSizeCap)) @@ -74,4 +77,19 @@ struct OnboardingViewRegular: Themea ) .padding(.bottom) } + + private func handleAccessibilityScroll(from edge: Edge) { + if edge == .leading { + viewModel.scrollToPreviousPage() + } else if edge == .trailing { + viewModel.scrollToNextPage() + } + switch edge { + case .leading, .trailing: + DispatchQueue.main.async { + UIAccessibility.post(notification: .screenChanged, argument: nil) + } + default: break + } + } }