Skip to content

Commit 3959983

Browse files
[FXIOS-13321] Change fix, address root issue to avoid keyboard being hidden in PBM
1 parent e3901a8 commit 3959983

2 files changed

Lines changed: 6 additions & 19 deletions

File tree

firefox-ios/Client/Frontend/Browser/BrowserViewController/Views/BrowserViewController.swift

Lines changed: 3 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -837,13 +837,9 @@ class BrowserViewController: UIViewController,
837837
processAppleIntelligenceState()
838838
privacyWindowHelper.removeWindow()
839839

840-
if let tab = tabManager.selectedTab {
841-
if tab.isFindInPageMode {
842-
refreshFindInPageUI()
843-
} else {
844-
// Re-show toolbar which might have been hidden during scrolling (prior to app moving into the background)
845-
scrollController.showToolbars(animated: false)
846-
}
840+
if let tab = tabManager.selectedTab, !tab.isFindInPageMode {
841+
// Re-show toolbar which might have been hidden during scrolling (prior to app moving into the background)
842+
scrollController.showToolbars(animated: false)
847843
}
848844

849845
navigationHandler?.showTermsOfUse(context: .appBecameActive)
@@ -1726,17 +1722,6 @@ class BrowserViewController: UIViewController,
17261722
hasZoomPageBar: zoomPageBar != nil)
17271723
}
17281724

1729-
func refreshFindInPageUI() {
1730-
guard #available(iOS 16, *) else { return }
1731-
guard let tab = tabManager.selectedTab else { return }
1732-
guard tab.isPrivate, let webView = tab.webView, webView.isFindInteractionEnabled else { return }
1733-
1734-
// Ensure keyboard is available and Find In Page UI is refreshed in PBM (FXIOS-13321)
1735-
let text = webView.findInteraction?.searchText
1736-
updateFindInPageVisibility(isVisible: true)
1737-
webView.findInteraction?.searchText = text ?? ""
1738-
}
1739-
17401725
// TODO: SnapKit removal clean up
17411726
private func updateSnapKitOverKeyboardContainerConstraints() {
17421727
guard !isSnapKitRemovalEnabled else { return }

firefox-ios/Client/PrivacyWindowHelper.swift

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,9 @@ final class PrivacyWindowHelper {
1616
privacyWindow?.rootViewController?.view.backgroundColor = color
1717
// Set the privacy window level to be above alert windows (highest in importance).
1818
privacyWindow?.windowLevel = .alert + 1
19-
privacyWindow?.makeKeyAndVisible()
19+
// Avoid makeKeyAndVisible(), becoming key steals first responder
20+
// and causses iOS keyboard to dismiss on background/foreground in private mode.
21+
privacyWindow?.isHidden = false
2022
}
2123

2224
@MainActor

0 commit comments

Comments
 (0)