Skip to content

fix: Anchor context-menu snackbars above the browser toolbar - #4521

Open
mvanhorn wants to merge 1 commit into
mozilla-mobile:masterfrom
mvanhorn:fix/3746-snackbar-toolbar-anchoring
Open

fix: Anchor context-menu snackbars above the browser toolbar#4521
mvanhorn wants to merge 1 commit into
mozilla-mobile:masterfrom
mvanhorn:fix/3746-snackbar-toolbar-anchoring

Conversation

@mvanhorn

@mvanhorn mvanhorn commented Sep 3, 2026

Copy link
Copy Markdown

Pass the existing browser toolbar from BaseBrowserFragment into ContextMenuIntegration alongside the current parent view. Configure the production snackbar delegate used by link context-menu candidates to anchor each snackbar to that toolbar before display, while retaining the coordinator root as the snackbar's parent and preserving all candidate behavior. The Material snackbar anchor should then track the toolbar as ImeInsetsSynchronizer changes its position, keeping one consistent separation above the toolbar without independently applying the keyboard height.

Context-menu actions such as opening a link in a new tab display a snackbar from the browser fragment's coordinator root. Because the browser toolbar is a separate bottom-aligned view whose margins move during IME transitions, the snackbar can overlap the toolbar before the keyboard opens and retain roughly a keyboard-height gap after it opens. The issue provides a reproducible link-context-menu and keyboard sequence and identifies the IME behavior introduced around PR #3680. No prior or competing pull request is present in the supplied issue timeline.

Open a link in a new tab with the keyboard hidden and verify the snackbar is immediately above the bottom toolbar rather than overlapping it on the Z axis.
While that snackbar remains visible, focus the browser toolbar to show the IME and verify the snackbar remains directly above the moved toolbar with only the intended Material spacing, not an additional keyboard-height gap.
Dismiss the keyboard and verify the snackbar/toolbar relationship returns to the bottom of the visible browser area without stale margins or overlap.
Exercise the snackbar's existing SWITCH action and confirm it still selects the newly opened tab, proving that anchoring does not alter context-menu behavior.

Pull Request checklist

Fixes #3746

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.

Snackbars have wrong anchoring / padding

1 participant