JavaScript alert are dequeued in viewDidLayoutSubviews #24088
Labels
Contributor OK
This is a good issue for contributors interested in helping the project
Intermediate
Contributor task that requires generally small feature dev, simple pattern implementation, bug fix.
As discussed in https://github.com/mozilla-mobile/firefox-ios/pull/23757#discussion_r1904514229 and https://docs.google.com/document/d/1g4xn4CSDBqS5zfb7PdDIJES6iO8pQ_uKscTCxx_tvDE/edit?tab=t.0
✅ Ticket Action Items
Remove JS alert dequeue called from BVC
viewDidLayoutSubviews
and move it elsewhereviewDidAppear
andviewWillAppear
methods in BVC to know when the BVC is shown to the user. Example is when the tab tray is shown on iPhone, those lifecycle methods are not called since the tab tray is not shown full screen.tabManager(:didSelectedTabChange)
is too early and we cannot show the alert since the tab tray is still on screen when the alert is attempted to be shown, which result in this error:Attempt to present <Client.NewJSPromptAlertController: 0x12c808e00> on <Client.RootNavigationController: 0x10e809c00> (from <Client.BrowserViewController: 0x10d82ce00>) which is already presenting <Client.DismissableNavigationViewController: 0x10d940800>
┆Issue is synchronized with this Jira Task
The text was updated successfully, but these errors were encountered: