From 401304e8ec06c4644b857ed76d04ef5d7926be59 Mon Sep 17 00:00:00 2001 From: Kyle Hickinson Date: Tue, 3 Oct 2023 16:32:33 -0400 Subject: [PATCH] Fix #8183: Allow menu to be presented properly in compact-width iPads MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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. --- .../BrowserViewController+ToolbarDelegate.swift | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Sources/Brave/Frontend/Browser/BrowserViewController/BrowserViewController+ToolbarDelegate.swift b/Sources/Brave/Frontend/Browser/BrowserViewController/BrowserViewController+ToolbarDelegate.swift index 785b934d358..73bdbd77f65 100644 --- a/Sources/Brave/Frontend/Browser/BrowserViewController/BrowserViewController+ToolbarDelegate.swift +++ b/Sources/Brave/Frontend/Browser/BrowserViewController/BrowserViewController+ToolbarDelegate.swift @@ -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] } }