Skip to content

implement @primer/behaviors displayInViewport for ActionMenu - #7500

Merged
francinelucca merged 11 commits into
mainfrom
test/pin-behaviors-canary-add-sample-story
Feb 6, 2026
Merged

implement @primer/behaviors displayInViewport for ActionMenu#7500
francinelucca merged 11 commits into
mainfrom
test/pin-behaviors-canary-add-sample-story

Conversation

@francinelucca

@francinelucca francinelucca commented Feb 3, 2026

Copy link
Copy Markdown
Member

Relates to https://github.com/github/primer/issues/6361

This pull request enhances the ActionMenu component in several ways, focusing on improving its usability within dialogs and adding more flexibility to its overlay positioning. The most notable changes include the addition of a new example demonstrating ActionMenu inside a dialog, support for constraining overlays to the viewport, and a minor dependency update for @primer/behaviors.

Changelog

New

  • Added a default max-height: 100vh to .ActionMenuContainer in ActionMenu.module.css to ensure overlays do not exceed the viewport height.
  • InsideDialog example to ActionMenu.examples.stories.tsx demonstrating how ActionMenu can be used interactively inside a scrollable dialog.

Changed

  • update @primer/behaviors version to. v 1.10.2
  • Extended the ActionMenu.Overlay and AnchoredOverlay components to accept a new displayInViewport prop, allowing overlays to be constrained within the viewport for better handling in dialogs and scrollable layouts.

Removed

Rollout strategy

  • Patch release
  • Minor release
  • Major release; if selected, include a written rollout or migration plan
  • None; if selected, include a brief description as to why

Testing & Reviewing

Merge checklist

@changeset-bot

changeset-bot Bot commented Feb 3, 2026

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: 8933a55

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

@github-actions github-actions Bot added the staff Author is a staff member label Feb 3, 2026
@github-actions

github-actions Bot commented Feb 3, 2026

Copy link
Copy Markdown
Contributor

👋 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. Or, apply the integration-tests: skipped manually label to skip these checks.

@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 Feb 3, 2026
@francinelucca francinelucca added the skip changeset This change does not need a changelog label Feb 3, 2026
@github-actions
github-actions Bot requested a deployment to storybook-preview-7500 February 5, 2026 00:17 Abandoned
@github-actions
github-actions Bot temporarily deployed to storybook-preview-7500 February 5, 2026 00:31 Inactive
…om:primer/react into test/pin-behaviors-canary-add-sample-story
@github-actions
github-actions Bot requested a deployment to storybook-preview-7500 February 5, 2026 18:25 Abandoned
@francinelucca francinelucca changed the title pin behaviors to canary version and add sample story implement @primer/behaviors displayInViewport for ActionMenu Feb 5, 2026
@github-actions
github-actions Bot requested a deployment to storybook-preview-7500 February 5, 2026 18:30 Abandoned
@github-actions
github-actions Bot temporarily deployed to storybook-preview-7500 February 5, 2026 18:39 Inactive
@francinelucca
francinelucca marked this pull request as ready for review February 6, 2026 06:38
@francinelucca
francinelucca requested a review from a team as a code owner February 6, 2026 06:38

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 pull request implements support for displayInViewport from @primer/behaviors in the ActionMenu and AnchoredOverlay components to improve overlay positioning within dialogs and scrollable containers. The changes enhance the ActionMenu's usability by ensuring overlays remain constrained within the viewport, preventing overflow issues.

Changes:

  • Added displayInViewport prop support to ActionMenu.Overlay and AnchoredOverlay components, allowing overlays to be constrained within the viewport
  • Updated @primer/behaviors dependency from v1.10.0 to v1.10.2 to support the new functionality
  • Added default max-height: 100vh CSS rule to .ActionMenuContainer to prevent overlays from exceeding viewport height
  • Created InsideDialog example story demonstrating ActionMenu usage within a scrollable dialog

Reviewed changes

Copilot reviewed 5 out of 6 changed files in this pull request and generated no comments.

Show a summary per file
File Description
packages/react/src/AnchoredOverlay/AnchoredOverlay.tsx Extends type definition to include displayInViewport and threads the prop to useAnchoredPosition hook
packages/react/src/ActionMenu/ActionMenu.tsx Extends MenuOverlayProps type to include displayInViewport and passes it to AnchoredOverlay component
packages/react/src/ActionMenu/ActionMenu.module.css Adds default max-height: 100vh to .ActionMenuContainer to constrain overlays within viewport
packages/react/src/ActionMenu/ActionMenu.examples.stories.tsx Adds comprehensive InsideDialog example demonstrating the new feature with scrollable content
packages/react/package.json Updates @primer/behaviors dependency to v1.10.2
package-lock.json Updates dependency tree for @primer/behaviors and workspace version references

@primer-integration

Copy link
Copy Markdown

👋 Hi from github/github-ui! Your integration PR is ready: https://github.com/github/github-ui/pull/13058

@primer-integration

Copy link
Copy Markdown

Integration test results from github/github-ui:

Passed  CI   Passed
Passed  VRT   Passed
Passed  Projects   Passed

All checks passed!

@TylerJDev TylerJDev left a comment

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.

LGTM!

@francinelucca
francinelucca added this pull request to the merge queue Feb 6, 2026
Merged via the queue into main with commit dd7bb1b Feb 6, 2026
52 checks passed
@francinelucca
francinelucca deleted the test/pin-behaviors-canary-add-sample-story branch February 6, 2026 21:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

integration-tests: recommended This change needs to be tested for breaking changes. See https://arc.net/l/quote/tdmpakpm skip changeset This change does not need a changelog staff Author is a staff member

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants