Skip to content

Fix toolbar floating at the top and not following web content observations - #4653

Open
jonalmeida wants to merge 2 commits into
masterfrom
fix-floating-toolbar
Open

jonalmeida wants to merge 2 commits into
masterfrom
fix-floating-toolbar

Conversation

@jonalmeida

@jonalmeida jonalmeida commented Nov 9, 2026 •

Copy link
Copy Markdown
Collaborator

Tested the first commit against a few examples listed here: https://jonalmeida.com/blog/browser-test-sites/bottom-toolbar.html

Buggy behaviour on FX-{01-03} (amongst others that I didn't record):

Screen_recording_20261109_171733.mp4

Fixed behaviour:

Screen_recording_20261109_174454.mp4

Pull Request checklist

@jonalmeida
jonalmeida requested a review from mcarare November 9, 2026 22:14
@jonalmeida jonalmeida changed the title Fix floating toolbar Fix toolbar floating at the top and not following web content observations Nov 9, 2026
…ppingBehavior

This regressed in 94e84c3, which migrated to the two-height
EngineViewClippingBehavior API and dropped the old ToolbarPosition.BOTTOM
argument without moving the height to the matching slot.
We aren't using it or actively working on it, so let's remove it.

Additionally, we have a Compose toolbar that has taken a different
direction for it's implementation.
@jonalmeida
jonalmeida force-pushed the fix-floating-toolbar branch from 22fdd73 to efd5579 Compare November 9, 2026 22:38
@mergify

mergify Bot commented Nov 9, 2026

Copy link
Copy Markdown

Tick the box to add this pull request to the merge queue (same as @mergifyio queue).

  • Queue this pull request

@rvandermeulen rvandermeulen 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.

Thanks, the height fix looks right: toolbar.height was read before layout and went into the top slot, so the bottom translation was always clamped to 0. Two inline questions below, plus a nit: "for it's implementation" in the second commit message should be "its".

)

val bottomToolbarHeight = resources.getDimensionPixelSize(R.dimen.browser_toolbar_height)
engineView.setDynamicToolbarMaxHeight(bottomToolbarHeight)

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.

Moving this into BaseBrowserFragment means custom tabs and PWAs (ExternalAppBrowserFragment) now get the full toolbar height instead of 0. That seems right, since they use the same bottom toolbar, but it's worth a mention in the commit message and a quick check on a custom tab.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Confirmed it works in a custom tab.

Screen_recording_20261109_233139.mp4

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.

2 participants