Closed Bug 1997575 Opened 4 months ago Closed 3 months ago

Perplexity toolbar hides behind the keyboard

Categories

(Firefox for Android :: Search, defect)

All
Android
defect

Tracking

()

VERIFIED FIXED
Tracking Status
firefox144 --- unaffected
firefox145 --- verified
firefox146 --- verified

People

(Reporter: vtamas, Assigned: boek)

References

Details

(Keywords: webcompat:sitepatch-applied, Whiteboard: [fxdroid][group1])

Attachments

(7 files, 1 obsolete file)

Preconditions

On Firefox for Android Nightly - Secret Settings - enable the "Remote Search Configuration" toggle, and restart the app.

Steps to reproduce

  1. On the search bar, tap the search engine icon drop-down menu.
  2. Select Perplexity search engine.
  3. Type a keyword and perform a search.
  4. Tap the perplexity toolbar.

Expected behavior

The Perplexity toolbar is displayed above the keyboard and is fully visible.

Actual behavior

Perplexity toolbar is displayed behind the keyboard.

Device information

  • Firefox version: Firefox for Android 146 (2025-10-30) and Firefox 145 beta 8
  • Android device model: Samsung S24 Ultra (Android 15) and Xiaomi 12T (Android 12)

After spending the day investigating this I found that there are a handful of things that we are trying to coordinate that are contributing to this behavior. First is GeckoView which allows the client to set setDynamicToolbarMaxHeight and setVerticalClipping. It also monitors the visibility of the software keyboard and calls session.onKeyboardHeight. Second is EngineViewClippingBehavior which manipulates the Y position of the web view and adjusts its vertical clipping based on the Y position of the top toolbar and lastly ImeInsetsSynchronizer which Fenix uses to animate the toolbar.

It may be that Fenix and GeckoView are responding to the software keyboard being presented in conflicting ways.

After further investigation it appears that there is some odd behavior when the keyboard is visible in this use case.. This change fixes it for Perplexity but I am guessing this is not the correct fix and will likely cause regressions elsewhere. I also found this FIXME in the same file that looks suspiciously similar to what I was trying to fix here.

Any help with this would be much appreciated

This seems like an APZ issue related to the toolbar: it does not reproduce with a fixed toolbar, only with the dynamic one.
Seems like dynamicToolbarMaxHeight is not accounted for in dvh?
(The issue reproduces easily for any searches in the perplexity.ai website)
@Botond @Hiro Can you help here as this is a very high priority on mobile?

Flags: needinfo?(hikezoe.birchill)
Flags: needinfo?(botond)

Also saw in both Chrome and Firefox that sometimes the layout just doesn't update & its bottom part gets ocluded by the keyboard.

With allowing users actually refine their search being so important
An interim hack we could make in Fenix is to just set the bottom toolbar as fixed when on the perplexity.ai website.

Pretty sure we are probably hitting this code. Hiro, it probably needs to become more subtle?

Whiteboard: [fxdroid][group1]

In my local built Fenix there's no option of Perplexity. The built is a bit stable, it's two week ago. I am going to update to the latest one.

:petru

This seems like an APZ issue related to the toolbar: it does not reproduce with a fixed toolbar, only with the dynamic one.

Just wanted to add a bit of context here: the reason why static bar doesn't appear to have this issue is because the container for the gecko sits on top of the toolbar. So that when we add bottom margin to the whole fragment view, the gecko view container isn't drawn directly above the keyboard; it's drawn still on top of the toolbar.

You could still see that something is off even with the static bar if you set come 'setVerticalClipping' to it. The gecko(view?) would respect it while there is not keyboard shown (you can space the dialog up as high as you want), but once the keyboard is up - the dialog will be put right at the bottom of the geckoview, ignoring the vertical clipping you have set.

Now that I wrote it down, I think a video would be helpful here. In the video the only thing I changed in the code is setting vertical clipping for the fixed toolbar (here).

And I believe that the dynamic toolbar is facing the same issue: the clipping works well when there is not keyboard, but once we adjust the size of the gecko container - vertical clipping isn't being respected.

As a side note, I am trying to remember how it used to work awhile back - did we always adjust the size of the gecko container here? I had a feeling we used to have a different keyboard strategy, and wonder if Gecko supports resizing well.

Hiro,

First you have to enable secret settings: Settings > About Firefox > Tap the firefox logo 5-7 times
Once inside secret settings (Settings > Secret settings) Look for the toggle labeled "Remote Search Configuration" and disable it and restart the application. This will tell Fenix to use the staging server.

Once you do that you should be able to perform a search with Perplexity

(In reply to Hiroyuki Ikezoe (:hiro) from comment #8)

In my local built Fenix there's no option of Perplexity. The built is a bit stable, it's two week ago. I am going to update to the latest one.

To enable Perplexity in the search engine options, one should go into secret settings and disable (!) the "Use remote settings production server (staging will be used when disabled) (requires restart).

You could also just go directly to Perplexity website and use the search :)

oh jeff beat me to it

That's something that I find odd - a set clipping is being ignored when the keyboard is up. It looks like it is 0 after the keyboard pops up?

Thank you both. With disabling the secret setting, I do see a new search engine, but it's eBay, not Perplexity. :/

perplexity.ai website only allows me downloading their application. :/ I can't search anything there.

Can anyone check the interactive-widget value on the site?If it's overlays-content, the current behavior isn't a bug.

But, as per the recording in comment 0, it seems to be resizes-visual (or no interactive-widget).

One relevant bug I know is bug 1993407. Adding it in see also.

Note that with resizes-visual while the software keyboard is being shown, any *vh units should not be affected by the toolbar height change. So I think this bug is unrelated to vh units.

See Also: → 1993407

Okay, finally got the option with disabling "Use remote settings production server (staging will be used when disabled)" and enabling "Remote Search Configuration". I flipped them repeatedly so I am not sure what the trigger was.

I think this bug will be fixed by either bug 1988730 or bug 1993407.

There may be other ways to fix this bug though.

A test case for this bug has been attached in bug 1993407 comment 0. The STR is;

  1. Open https://bugzilla.mozilla.org/attachment.cgi?id=9519142
  2. Tap the input element at the bottom of the page
Depends on: 1993407, 1988730
Flags: needinfo?(hikezoe.birchill)
See Also: 1993407
Flags: needinfo?(botond)

Can anyone check the interactive-widget value on the site?If it's overlays-content, the current behavior isn't a bug.

What would be an easy way to check? I want to say it is InteractiveWidget::OverlaysContent because when I remove the keyboard height out of the equation the the fixed element appears in the correct place.

Flags: needinfo?(hikezoe.birchill)

Yeah, it's easy. Just do document.querySelector("meta[name=viewport]") to see what interactive-widget value is. If nothing is specified, we use resizes-visual since it's default among all browser engines.

Note that I've confirmed there's no interactive-widget value on the site.

Flags: needinfo?(hikezoe.birchill)

A hacky workaround is to insert interactive-widget=resizes-content into the meta viewport by using our intervention, FWIW.

Though it's a bit hacky, it might be reasonable since I don't think we can fix 1993407 soon, and I guess we can't fix bug 1988730 soon either.

Flags: needinfo?(hikezoe.birchill)

Sorry, not sure how that happened. If I use the debugger to manually insert interactive-widget=resizes-content into the meta viewport I am still experiencing the issue. Is there another way to test it?

Too many debuggers 🙈. I confirm that this fixed it on my end.

Flags: needinfo?(hikezoe.birchill)

Note that document.querySelector("meta[name=viewport]").setAttribute("content", "width=device-width,initial-scale=1,interactive-widget=resizes-content") is an easy way, FWIW.

Is there a downside to temporarily shipping an intervention until we can come up with a fix?

It's hard to anticipate, it depends on what the site does, specifically usage of *vh units. For example, if the site uses, say 1vh for font-size, then when the software keyboard is shown with interactive-widget=resizes-content, the font size would be smaller than the one without the software keyboard.

Do you know if its possible to ship an intervention disabled by default for testing? Or roll it out with something like nimbus?

Assignee: nobody → jboek
Attachment #9525211 - Attachment description: WIP: Bug 1997575 - Implements a webcompat intervention for Perplexity → Bug 1997575 - Implements a webcompat intervention for Perplexity
Status: NEW → ASSIGNED
Attachment #9524342 - Attachment is obsolete: true
Pushed by twisniewski@mozilla.com: https://github.com/mozilla-firefox/firefox/commit/d19bad8fc53d https://hg.mozilla.org/integration/autoland/rev/78df3a3d7162 Implements a webcompat intervention for Perplexity r=webcompat-reviewers,twisniewski

This issue is verified as fixed on Firefox for Android Nightly 147 (2025-11-14) using Samsung S24 Ultra (Android 15), Xiaomi 12 T (Android 12) and Oppo Find X3 Neo (Android 11). Confirming that the perplexity searchbar is correctly displayed above the keyboard.

Attachment #9526881 - Flags: approval-mozilla-beta?
Attachment #9526882 - Flags: approval-mozilla-release?

firefox-release Uplift Approval Request

  • User impact if declined: Android users will be unable to access the toolbar of the Perplexity search engine, as it will be covered by the on-screen Android keyboard, breaking the user experience.
  • Code covered by automated testing: yes
  • Fix verified in Nightly: yes
  • Needs manual QE test: yes
  • Steps to reproduce for manual QE testing: 1. on Firefox for Android, visit https://perplexity.ai?pc=firefox&q=firefox.
  1. tap to ask a follow-up question.
  2. confirm that the Android on-screen keyboard pops up, and does not cover the Perplexity toolbar
  • Risk associated with taking this patch: low
  • Explanation of risk level: Low, because this only affects Perplexity search on Android Firefox, and we cannot break it much worse than it currently is without this fix.
  • String changes made/needed: none
  • Is Android affected?: yes
Flags: qe-verify+

firefox-beta Uplift Approval Request

  • User impact if declined: Android users will be unable to access the toolbar of the Perplexity search engine, as it will be covered by the on-screen Android keyboard, breaking the user experience.
  • Code covered by automated testing: yes
  • Fix verified in Nightly: yes
  • Needs manual QE test: yes
  • Steps to reproduce for manual QE testing: 1. on Firefox for Android, visit https://perplexity.ai?pc=firefox&q=firefox.
  1. tap to ask a follow-up question.
  2. confirm that the Android on-screen keyboard pops up, and does not cover the Perplexity toolbar
  • Risk associated with taking this patch: low
  • Explanation of risk level: Low, because this only affects Perplexity search on Android Firefox, and we cannot break it much worse than it currently is without this fix.
  • String changes made/needed: none
  • Is Android affected?: yes
Attachment #9526882 - Flags: approval-mozilla-release? → approval-mozilla-release+
Attachment #9526881 - Flags: approval-mozilla-beta? → approval-mozilla-beta+

This issue has been tested on Firefox for Android 146 beta 4 and Firefox RC 145 using a Samsung S24 Ultra (Android 15) and Nothing Phone 1 (Android 12).

Confirming that the Perplexity searchbar is no longer covered by the on-screen Android keyboard, but an extra space was spotted between the keyboard and the Perplexity searchbar when the Toolbar Layout is set to Expended mode (reproducible across all versions) - Bug 2000880 .

Considering that the follow-up issue is tracked separately I am marking this bug as Verified.

Status: ASSIGNED → RESOLVED
Closed: 3 months ago
Resolution: --- → FIXED
See Also: → 2000880
Flags: qe-verify+

Hey boek, bug 1993407 and bug 1988730 have been fixed in mozilla-central. So now we can drop the intervention.

(to be precise, either one of the two bugs should fix this bug, we didn't need both.)

Flags: needinfo?(jboek)

Thanks for the heads up! I will test today!

Flags: needinfo?(jboek)
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: