Skip to content

Fix(overlays): Panels stay on triggers that do not scroll with the page - #334

Open
razorfever wants to merge 6 commits into
mainfrom
overlay-fixed-anchors
Open

razorfever wants to merge 6 commits into
mainfrom
overlay-fixed-anchors

Conversation

@razorfever

Copy link
Copy Markdown
Contributor

Safari 26's native anchor positioning moves a panel by the scroll distance when its trigger sits in a fixed or sticky box. Reported on iOS: the docs toolbar's menus sank as the page scrolled, and opened that far below their trigger after a scroll.

Changes

  • A panel whose trigger sits in a fixed or sticky box (a pinned toolbar, a modal, a top-layer panel) is placed by Floating UI in every browser. This is decided at each open. Triggers in the page flow keep native positioning.
  • Designated triggers (trigger prop) are always placed this way. The fixed-position proxy anchor is removed (ADR-0038 amended).
  • A designated c-button (any display: contents host) used to open its panel at the page's top-left corner. It now opens against the button. This bug predates the change.
  • Placement starts with showPopover(), before the first paint.
  • ADR-0056 amended.

Tests

New conformance scenarios for every overlay tag:

  • a trigger in a pinned box, while the page scrolls and when opened after a scroll;
  • a designated trigger;
  • a designated c-button;
  • a trigger inside a c-modal whose content scrolls.

They pass on Chromium and Firefox locally. Without the fix, 21 of the pinned and designated cases fail on Chromium. WebKit runs here for the first time.

Before merging: iOS check by the reporter

  1. Tell us your iOS version.
  2. On the live site, open a toolbar menu and scroll; scroll, then open one; open a c-popover demo and scroll. Confirm the drift shows.
  3. Repeat the same steps on this PR's deploy preview, on the same phone, without updating iOS in between.

Merge only once it drifts on the live site and holds on the preview. Hold Version PR #333 until this merges.

After release: when MyCSC moves to 4.0.1, check a select, an autocomplete and a date picker in a modal form while scrolling the modal, in Safari and Chrome. The docs have no modal with a field, so the preview can't cover it.

🤖 Generated with Claude Code

razorfever and others added 6 commits November 20, 2026 13:39
Safari 26 places a natively anchored panel the scroll distance off when its
anchor sits in a fixed or sticky box: the docs' pinned toolbar menus sank as
the page scrolled, and opened that far below their trigger after a scroll.
Such panels are now placed by Floating UI in every browser, decided at each
open, and so is every designated trigger's panel, whose fixed-position proxy
anchor is gone. The placement starts with showPopover(), before the first
paint, not on the queued toggle event.

The conformance suite checks for every overlay that a panel in a pinned box
stays on its trigger while the page scrolls and when opened after a scroll,
and that it is placed by script. The corner scenarios moved out of fixed
stages so their native runs stay native.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A designated trigger whose host is `display: contents`, such as a `c-button`,
has no box of its own and measured as an empty rect at 0,0, so its menu,
popover or tooltip opened at the page's top-left corner. Such a reference is
now measured by the union of the boxes it renders.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A modal dialog is fixed, so since the Safari 26 fix every panel opened from
a form in a c-modal is placed by script, in every browser. The conformance
suite now opens each overlay in a modal and scrolls the modal's content. The
harness's `mount()` takes a `parent` to mount into.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@netlify

netlify Bot commented Nov 20, 2026 •

Copy link
Copy Markdown

✅ Deploy Preview for csc-design-system ready!

Name Link
🔨 Latest commit b49c750
🔍 Latest deploy log https://app.netlify.com/projects/csc-design-system/deploys/6b00521a800d5e0d6bcc0400
😎 Deploy Preview https://deploy-preview-334--csc-design-system.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

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