Skip to content
This repository has been archived by the owner on May 10, 2024. It is now read-only.

Commit

Permalink
Fix #3838: Improve menu accessibility
Browse files Browse the repository at this point in the history
- Adds support for accessibility escape while VoiceOver is active
- Increases the top inset so there is always space to tap to dismiss the menu
  • Loading branch information
kylehickinson committed Jun 24, 2021
1 parent 0434b72 commit fd92dcd
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -536,6 +536,11 @@ class BookmarksViewController: SiteTableViewController, ToolbarUrlActionsProtoco
self.navigationController?.pushViewController(vc, animated: true)
}
}

override func accessibilityPerformEscape() -> Bool {
dismiss(animated: true)
return true
}
}

extension BookmarksViewController: BookmarksV2FetchResultsDelegate {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,11 @@ class MenuViewController: UINavigationController, UIPopoverPresentationControlle
private var isPresentingInnerMenu: Bool {
presentedViewController is InnerMenuNavigationController
}

override func accessibilityPerformEscape() -> Bool {
dismiss(animated: true)
return true
}
}

extension MenuViewController: PanModalPresentable {
Expand Down Expand Up @@ -198,7 +203,7 @@ extension MenuViewController: PanModalPresentable {
return _scrollViewChild(in: topVC.view)
}
var longFormHeight: PanModalHeight {
.maxHeight
.maxHeightWithTopInset(32)
}
var shortFormHeight: PanModalHeight {
isPresentingInnerMenu ? .maxHeight : .contentHeight(initialHeight)
Expand Down

0 comments on commit fd92dcd

Please sign in to comment.