Skip to content

Bugfix FXIOS-13321 Fix 'Find In Page' UI when resuming app in private tab#33874

Merged
mattreaganmozilla merged 3 commits into
mozilla-mobile:mainfrom
mattreaganmozilla:mr/13321
May 21, 2026
Merged

Bugfix FXIOS-13321 Fix 'Find In Page' UI when resuming app in private tab#33874
mattreaganmozilla merged 3 commits into
mozilla-mobile:mainfrom
mattreaganmozilla:mr/13321

Conversation

@mattreaganmozilla

@mattreaganmozilla mattreaganmozilla commented May 18, 2026

Copy link
Copy Markdown
Collaborator

📜 Tickets

Jira ticket
Github issue

💡 Description

  • Fixes an issue where the Find In Page UI is positioned incorrectly in PBM after resuming the app
  • Renames the findInPageBar so it's clear it is only for iOS 15 backwards-compat

For the Find In Page UI issues, the root problem is that the keyboard is dismissed, so the change here ensures the UI is updated so that the keyboard is available if search is active.

📸 Demo

fix3.mov

📝 Checklist

  • I filled in the ticket numbers and a description of my work
  • I updated the PR name to follow our PR naming guidelines
  • I ensured unit tests pass and wrote tests for new code
  • If working on UI, I checked and implemented accessibility (Dynamic Text and VoiceOver)
  • If adding telemetry, I read the data stewardship requirements and will request a data review
  • If adding or modifying strings, I read the guidelines and will request a string review from l10n
  • If needed, I updated documentation and added comments to complex code

@mattreaganmozilla mattreaganmozilla requested a review from a team as a code owner May 18, 2026 17:55
@mattreaganmozilla

Copy link
Copy Markdown
Collaborator Author

@yoanarios I'm still doing a bit more investigation here but wanted to get a PR up for review. LMK if you'd like to sync further to discuss, you have more context on this UI than I do.

Clean-up

Rename FindInPageBar so it's clear this is a deprecated property

Comment

[FXIOS-13321] Updates to Find In Page UI fix

[FXIOS-13321] Cleanup, fix logic for refactor

[FXIOS-13321] Limit to PBM

Minor comment cleanup
@yoanarios

Copy link
Copy Markdown
Contributor

Were you able to investigate why the keyboard is dismissed only on PBM when going to the background? I didn't get the chance to work on the bug, but it always bothered me that it was only in private browsing and could be related to WebKit behaviour tied to private data stores 🤷‍♀️. I just want to rule out that we are not doing some extra handling for private mode that is causing the dismissal of the keyboard and is the root cause of the bug

@mattreaganmozilla

Copy link
Copy Markdown
Collaborator Author

Were you able to investigate why the keyboard is dismissed only on PBM when going to the background? I didn't get the chance to work on the bug, but it always bothered me that it was only in private browsing and could be related to WebKit behaviour tied to private data stores 🤷‍♀️. I just want to rule out that we are not doing some extra handling for private mode that is causing the dismissal of the keyboard and is the root cause of the bug

@yoanarios Yeah initially I'd assumed that this was intentional but it looks like this is actually an unintended side effect of our PrivacyWindowHelper. In PBM when the app is backgrounded we add that window and call makeKey which causes the normal first responder to lose focus and the iOS keyboard is dismissed.

I've changed the fix in this PR so that it addresses the root issue and doesn't inadvertently hide the keyboard, which resolves this bug. I suspect this might actually fix a couple related issues we're seeing also. Possibly #32873 🤔, because I suspect that has something to do with the keyboard state change updates in PBM.

I should add: in my testing this fix still allows the privacy screen to work fine, Firefox is obscured in the app switcher when in PBM. But LMK if anyone has any concerns. (+cc @thatswinnie )

@yoanarios

Copy link
Copy Markdown
Contributor

Were you able to investigate why the keyboard is dismissed only on PBM when going to the background? I didn't get the chance to work on the bug, but it always bothered me that it was only in private browsing and could be related to WebKit behaviour tied to private data stores 🤷‍♀️. I just want to rule out that we are not doing some extra handling for private mode that is causing the dismissal of the keyboard and is the root cause of the bug

@yoanarios Yeah initially I'd assumed that this was intentional but it looks like this is actually an unintended side effect of our PrivacyWindowHelper. In PBM when the app is backgrounded we add that window and call makeKey which causes the normal first responder to lose focus and the iOS keyboard is dismissed.

I've changed the fix in this PR so that it addresses the root issue and doesn't inadvertently hide the keyboard, which resolves this bug. I suspect this might actually fix a couple related issues we're seeing also. Possibly #32873 🤔, because I suspect that has something to do with the keyboard state change updates in PBM.

I should add: in my testing this fix still allows the privacy screen to work fine, Firefox is obscured in the app switcher when in PBM. But LMK if anyone has any concerns. (+cc @thatswinnie )

Amazing, thank you for looking into the root cause. No concerns from my side, code-wise, this looks good to me. I’ll just do some sanity testing.

@yoanarios yoanarios left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 🚀, tested and is working as expected

@mobiletest-ci-bot

Copy link
Copy Markdown
Messages
📖 Project coverage: 42.26%

🧹 Tidy commit

Just 3 file(s) touched. Thanks for keeping it clean and review-friendly!

💬 Description craftsman

Great PR description! Reviewers salute you 🫡

🦊 BrowserViewController Check

We’re tracking the size of BrowserViewController.swift to keep it healthy.

  • ✨ Change in file size: +4 lines

✅ New file code coverage

No new file detected so code coverage gate wasn't ran.

✅ Existing file code coverage

All modified files meet their thresholds.

Client.app: Coverage: 40.74

File Coverage
PrivacyWindowHelper.swift 0.0% ⚠️
BrowserViewController+FindInPage.swift 9.62% ⚠️
BrowserViewController.swift 36.16% ⚠️

Generated by 🚫 Danger Swift against 3959983

@mattreaganmozilla mattreaganmozilla merged commit bad826c into mozilla-mobile:main May 21, 2026
9 checks passed
@github-actions

Copy link
Copy Markdown
Contributor

🚀 PR merged to main, targeting version: 151.2

Alex-Bangu pushed a commit that referenced this pull request May 25, 2026
… tab (#33874)

* [FXIOS-13321] Initial fix for broken Find In Page UI behavior in PBM

Clean-up

Rename FindInPageBar so it's clear this is a deprecated property

Comment

[FXIOS-13321] Updates to Find In Page UI fix

[FXIOS-13321] Cleanup, fix logic for refactor

[FXIOS-13321] Limit to PBM

Minor comment cleanup

* [FXIOS-13321] Refactor for readability

* [FXIOS-13321] Change fix, address root issue to avoid keyboard being hidden in PBM
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants