Skip to content

Fix blank space in browser activity#8537

Open
aibrahim- wants to merge 1 commit into
developfrom
aibrahim/bugfix/blank-space-bottom
Open

Fix blank space in browser activity#8537
aibrahim- wants to merge 1 commit into
developfrom
aibrahim/bugfix/blank-space-bottom

Conversation

@aibrahim-
Copy link
Copy Markdown
Contributor

@aibrahim- aibrahim- commented May 12, 2026

Task/Issue URL: https://app.asana.com/1/137249556945/project/1212608036467427/task/1214444878566531?focus=true

Description

If a page load completes (which triggers computeBottomMarginIfNeeded), while a keyboard is being launched at the same time, there's a window where the child (browserLayout) would still be smaller in height than the parent (rootView), this would happen mid-layout and it would later match the parent size, but this causes the computeBottomMarginIfNeeded to incorrectly adjusts the browserLayout to match its parent and adds a persistent diff that is exactly the keyboard IME size.

Steps to test this PR

This is a race-condition that's hard to replicate, so it will need mutliple tries. also for some-reason enabling native-input with the toggle disabled makes it easier to repro.

  • open a new website.
  • try to open the keyboard by tapping the address bar as the page is about to finish loading.

I was able to verify the fix by having a log in the if statement added here, this log always triggers when the bug repros, and with the fix in place, the bug doesn't repro anymore.


Note

Low Risk
Low risk: small, localized guard in CoordinatorLayoutHelper.computeBottomMarginIfNeeded to avoid applying an incorrect margin during an IME/layout race; main risk is skipping a needed margin update in some edge cases until the next layout pass.

Overview
Prevents a race where computeBottomMarginIfNeeded could permanently add the keyboard (IME) height to the child view’s bottomMargin while the parent is mid-resize.

The method now snapshots childHeight/parentHeight and bails out when the child reports a height larger than the parent, without updating lastYPosition, so a later call can recompute once layout has settled.

Reviewed by Cursor Bugbot for commit f5b8822. Bugbot is set up for automated code reviews on this repo. Configure here.

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.

1 participant