Skip to content

Commit

Permalink
Fix brave/brave-ios#8183: Allow menu to be presented properly in comp…
Browse files Browse the repository at this point in the history
…act-width iPads (brave/brave-ios#8184)

Unfortunately PanModal enforces the presentation to a `popover` on iPads regardless of size classes, so we must allow the arrow direction to be `down` as well here since the toolbar will be at the bottom on compact-width size classes. This also means that on iPads even with iPhone layouts they get shown as a popover which is not ideal and should be fixed later.
  • Loading branch information
kylehickinson authored Oct 3, 2023
1 parent d8bfac1 commit a39ab90
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -878,7 +878,7 @@ extension BrowserViewController: ToolbarDelegate {
presentPanModal(menuController, sourceView: tabToolbar.menuButton, sourceRect: tabToolbar.menuButton.bounds)
if menuController.modalPresentationStyle == .popover {
menuController.popoverPresentationController?.popoverLayoutMargins = .init(equalInset: 4)
menuController.popoverPresentationController?.permittedArrowDirections = [.up]
menuController.popoverPresentationController?.permittedArrowDirections = [.up, .down]
}
}

Expand Down

0 comments on commit a39ab90

Please sign in to comment.