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

Commit

Permalink
Fix #8421: Update the toolbar layout on viewWillAppear (#8422)
Browse files Browse the repository at this point in the history
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 committed Nov 16, 2023
1 parent fbe973b commit fb8a13a
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 fb8a13a

Please sign in to comment.