Skip to content

Allow CSS anchor positioning in SelectPanel settings#8026

Open
TylerJDev wants to merge 3 commits into
mainfrom
tylerjdev/allow-settings-css-anchor-select-panel
Open

Allow CSS anchor positioning in SelectPanel settings#8026
TylerJDev wants to merge 3 commits into
mainfrom
tylerjdev/allow-settings-css-anchor-select-panel

Conversation

@TylerJDev

@TylerJDev TylerJDev commented Jun 22, 2026

Copy link
Copy Markdown
Member

Part of github/primer#6750

Changelog

  • Add passthrough prop for CSS anchor positioning in SelectPanel

Rollout strategy

  • Patch release

Testing & Reviewing

  • Reproduced the issue described in github/primer#6750 in Firefox.
  • Verified the updated SelectPanel settings no longer trigger the disappearing dropdown behavior when hovered.
  • Please review in Firefox, since that’s the browser where the bug is reported.

Merge checklist

  • Added/updated tests
  • Added/updated documentation (Decided not to add to docs, as this prop shouldn't be used unless strictly needed)
  • Added/updated previews (Storybook)
  • Changes are SSR compatible
  • Tested in Chrome
  • Tested in Firefox
  • Tested in Safari
  • Tested in Edge
  • (GitHub staff only) Integration tests pass at github/github-ui (Learn more about how to run integration tests)

@changeset-bot

changeset-bot Bot commented Jun 22, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 1246c97

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@primer/react Minor

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

@github-actions github-actions Bot added the staff Author is a staff member label Jun 22, 2026
@github-actions

Copy link
Copy Markdown
Contributor

⚠️ Action required

👋 Hi, this pull request contains changes to the source code that github/github-ui depends on. If you are GitHub staff, test these changes with github/github-ui using the integration workflow. If this doesn't work, you can also use the original workflow here. Check the integration testing docs for step-by-step instructions. Or, apply the integration-tests: skipped manually label to skip these checks.

To publish a canary release for integration testing, apply the Canary Release label to this PR.

@github-actions github-actions Bot added the integration-tests: recommended This change needs to be tested for breaking changes. See https://arc.net/l/quote/tdmpakpm label Jun 22, 2026
@TylerJDev TylerJDev added the Canary Release Apply this label when you want CI to create a canary release of the current PR label Jun 22, 2026
@TylerJDev TylerJDev marked this pull request as ready for review June 22, 2026 15:51
@TylerJDev TylerJDev requested a review from a team as a code owner June 22, 2026 15:51
@TylerJDev TylerJDev requested review from Copilot and liuliu-dev June 22, 2026 15:51

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR exposes cssAnchorPositioningSettings on SelectPanel and forwards it to the underlying AnchoredOverlay, while still forcing CSS anchor positioning to be disabled for the modal variant (which is manually positioned). This enables consumers to adjust native CSS anchor positioning behavior to avoid browser-specific issues (notably in Firefox).

Changes:

  • Add cssAnchorPositioningSettings to SelectPanelProps (picked from AnchoredOverlayProps).
  • Forward cssAnchorPositioningSettings into AnchoredOverlay, merging it with a modal-safe disable override.
  • Add a changeset documenting the new API surface.
Show a summary per file
File Description
packages/react/src/SelectPanel/SelectPanel.tsx Adds a passthrough prop and forwards CSS anchor positioning settings to the underlying overlay with modal-safe disabling.
.changeset/select-panel-css-anchor-positioning-settings.md Declares the consumer-facing release note for the new SelectPanel prop.

Copilot's findings

  • Files reviewed: 2/2 changed files
  • Comments generated: 3

Comment on lines 132 to +137
export type SelectPanelProps = SelectPanelBaseProps &
Omit<FilteredActionListProps, 'selectionVariant' | 'variant' | 'message'> &
Pick<AnchoredOverlayProps, 'open' | 'height' | 'width' | 'align' | 'displayInViewport'> &
Pick<
AnchoredOverlayProps,
'open' | 'height' | 'width' | 'align' | 'displayInViewport' | 'cssAnchorPositioningSettings'
> &

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

agreed, does this need to be added to the .docs.json file?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@francinelucca I'm curious what you think - I was thinking of omitting it from the docs as this is something that we don't want consumers to utilize unless they specifically need it to resolve an issue. It's in a grey area between a private and public prop 🤔

Comment on lines +889 to +893
// Other cssAnchorPositioningSettings (e.g. fallbackStrategy) may be passed in and are forwarded here
cssAnchorPositioningSettings={{
...cssAnchorPositioningSettings,
disable: variant === 'modal' || cssAnchorPositioningSettings?.disable,
}}
Comment thread .changeset/select-panel-css-anchor-positioning-settings.md Outdated
Comment on lines 132 to +137
export type SelectPanelProps = SelectPanelBaseProps &
Omit<FilteredActionListProps, 'selectionVariant' | 'variant' | 'message'> &
Pick<AnchoredOverlayProps, 'open' | 'height' | 'width' | 'align' | 'displayInViewport'> &
Pick<
AnchoredOverlayProps,
'open' | 'height' | 'width' | 'align' | 'displayInViewport' | 'cssAnchorPositioningSettings'
> &

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

agreed, does this need to be added to the .docs.json file?

Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
@primer-integration

Copy link
Copy Markdown

Integration test results from github/github-ui PR:

Failed  CI   Failed
Passed  VRT   Passed
Passed  Projects   Passed

CI check runs linting, type checking, and unit tests. Check the workflow logs for specific failures.

Need help? If you believe this failure is unrelated to your changes, please reach out to the Primer team for assistance.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Canary Release Apply this label when you want CI to create a canary release of the current PR integration-tests: recommended This change needs to be tested for breaking changes. See https://arc.net/l/quote/tdmpakpm staff Author is a staff member

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants