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

Fix #3838: Improve menu accessibility #3845

Merged
merged 1 commit into from
Jun 24, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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,10 +203,10 @@ extension MenuViewController: PanModalPresentable {
return _scrollViewChild(in: topVC.view)
}
var longFormHeight: PanModalHeight {
.maxHeight
.maxHeightWithTopInset(32)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this for this ticket or the last-bookmark-hidden one?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That is for this ticket:

Increases the top inset so there is always space to tap to dismiss the menu

It helps VoiceOver users or users with motor function disabilities to dismiss by tapping the background instead of being forced to dismiss by gesture

}
var shortFormHeight: PanModalHeight {
isPresentingInnerMenu ? .maxHeight : .contentHeight(initialHeight)
isPresentingInnerMenu ? .maxHeightWithTopInset(32) : .contentHeight(initialHeight)
}
var allowsExtendedPanScrolling: Bool {
true
Expand Down