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
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 15, 2023
1 parent 705bb48 commit 5b62ee0
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 @@ -1108,6 +1108,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 5b62ee0

Please sign in to comment.