Skip to content

Commit

Permalink
Fix brave/brave-ios#8421: Update the toolbar layout on `viewWillAppea…
Browse files Browse the repository at this point in the history
…r` (brave/brave-ios#8422)

On iOS 17 rotating the device with a full screen modal presented (e.g. Playlist, Tab Tray) to landscape then back to portrait does not trigger `traitCollectionDidChange`/`willTransition`/etc calls and so the toolbar remains in the wrong state.
  • Loading branch information
kylehickinson authored Nov 16, 2023
1 parent a761e6a commit 3efaa70
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions Sources/Brave/Frontend/Browser/BrowserViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -1109,6 +1109,12 @@ public class BrowserViewController: UIViewController {

override public func viewWillAppear(_ animated: Bool) {
super.viewWillAppear(animated)
if #available(iOS 17, *) {
// On iOS 17 rotating the device with a full screen modal presented (e.g. Playlist, Tab Tray)
// to landscape then back to portrait does not trigger `traitCollectionDidChange`/`willTransition`/etc
// calls and so the toolbar remains in the wrong state.
updateToolbarStateForTraitCollection(traitCollection)
}
updateToolbarUsingTabManager(tabManager)

if let tabId = tabManager.selectedTab?.rewardsId, rewards.rewardsAPI?.selectedTabId == 0 {
Expand Down

0 comments on commit 3efaa70

Please sign in to comment.