AnchoredOverlay: Add support for CSS anchor positioning#7604
AnchoredOverlay: Add support for CSS anchor positioning#7604siddharthkp merged 87 commits intomainfrom
Conversation
🦋 Changeset detectedLatest commit: 1364a4d The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
|
|
🤖 Lint and formatting issues have been automatically fixed and committed to this PR. |
|
🤖 Lint issues have been automatically fixed and committed to this PR. |
|
🤖 Lint issues have been automatically fixed and committed to this PR. |
|
🤖 Lint and formatting issues have been automatically fixed and committed to this PR. |
|
🤖 Lint issues have been automatically fixed and committed to this PR. |
|
🤖 Lint issues have been automatically fixed and committed to this PR. |
This reverts commit ef646f9.
There was a problem hiding this comment.
I added e2e tests to compare this PR against: diff.
The diffs are only present with the feature flag ON. So that's good! Even though this feature isn't perfect yet, we can merge and continue to iterate on it.
Regressed:
AnchoredOverlay-Anchor-Alignment: default is not centered anymore.
AnchoredOverlay-Scroll-With-Anchor: default is not centered anymore
AnchoredOverlay-Fullscreen-Variant: Not fullscreen anymore
AnchoredOverlay-Offset-Alignment-From-Anchor: offset not respected
AnchoredOverlay-Offset-Position-From-Anchor: offset not respected
This reverts commit 4471c00.
|
👋 Hi from github/github-ui! Your integration PR is ready: https://github.com/github/github-ui/pull/15793 |
|
Added |
The first batch of work to add CSS anchor positioning to overlay components.
Example of CSS anchor positioning:
Screen.Recording.2026-03-04.at.7.33.32.AM.mov
Video description
In the video, we show the `AnchoredOverlay` opening and being positioned directly under the trigger. We then show off the overlay repositioning when there's lack of space.
Changelog
New
AnchoredOverlay, gated by theprimer_react_css_anchor_positioningfeature flag.ActionMenuto ensure that the anchor button receives the correct anchor class for CSS anchor positioning, and improved merging of class names between anchor and button props.AnchoredOverlay.features.stories.tsxto demonstrate anchor positioning in various layouts, including centered overlays, grid layouts, within dialogs (including nested and overflowing dialogs), scroll containers, and sticky headers.Rollout strategy
Testing & Reviewing
Merge checklist