Skip to content

fix(AnchoredOverlay): use position-visibility:always to keep overlay visible when anchor is hidden in Firefox - #8294

Open
waterWang wants to merge 1 commit into
primer:mainfrom
waterWang:fix/anchored-overlay-firefox-position-visibility
Open

fix(AnchoredOverlay): use position-visibility:always to keep overlay visible when anchor is hidden in Firefox#8294
waterWang wants to merge 1 commit into
primer:mainfrom
waterWang:fix/anchored-overlay-firefox-position-visibility

Conversation

@waterWang

Copy link
Copy Markdown

Summary

Firefox defaults position-visibility to anchors-visible, which hides CSS-anchored elements when their anchor scrolls off-screen. This causes anchored overlays (ActionMenu, SelectPanel, Tooltip, etc.) to disappear in Firefox when the trigger element is scrolled out of view, while Chrome keeps them visible.

Setting position-visibility: always on .AnchoredOverlay ensures the overlay stays visible even when its anchor is hidden, matching Chrome behavior.

Changes

  • packages/react/src/AnchoredOverlay/AnchoredOverlay.module.css: position-visibility: always

Test Plan

  • Verified the CSS property change is correct per the CSS Anchor Positioning spec
  • Overlay behavior in Chrome is unchanged (Chrome already shows the overlay when anchor is hidden)
  • Fixes Firefox parity issue

Closes #8247

…visible when anchor is hidden in Firefox

Firefox defaults position-visibility to 'anchors-visible', which hides
the anchored overlay when its anchor element scrolls off-screen. This
causes anchored overlays like ActionMenu, SelectPanel, and Tooltip to
disappear in Firefox when the trigger element is scrolled out of view.

Setting position-visibility: always ensures the overlay stays visible
even when its anchor is hidden, matching Chrome's behavior.

Closes primer#8247
@waterWang
waterWang requested a review from a team as a code owner August 12, 2026 02:37
@waterWang
waterWang requested a review from TylerJDev August 12, 2026 02:37
@changeset-bot

changeset-bot Bot commented Aug 12, 2026

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: 0b60f8a

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@TylerJDev

Copy link
Copy Markdown
Member

@waterWang, LGTM! Do you mind adding a changeset?

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.

Keep floating element visible when its anchor is hidden (Firefox)

2 participants