implement @primer/behaviors displayInViewport for ActionMenu#7500
implement @primer/behaviors displayInViewport for ActionMenu#7500francinelucca wants to merge 10 commits intomainfrom
Conversation
|
|
👋 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 |
|
👋 Hi from github/github-ui! Your integration PR is ready: https://github.com/github/github-ui/pull/12518 |
…om:primer/react into test/pin-behaviors-canary-add-sample-story
|
There was a problem hiding this comment.
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
displayInViewportprop support toActionMenu.OverlayandAnchoredOverlaycomponents, allowing overlays to be constrained within the viewport - Updated
@primer/behaviorsdependency from v1.10.0 to v1.10.2 to support the new functionality - Added default
max-height: 100vhCSS rule to.ActionMenuContainerto prevent overlays from exceeding viewport height - Created
InsideDialogexample 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 |
Relates to https://github.com/github/primer/issues/6361
This pull request enhances the
ActionMenucomponent 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 demonstratingActionMenuinside a dialog, support for constraining overlays to the viewport, and a minor dependency update for @primer/behaviors.Changelog
New
max-height: 100vhto.ActionMenuContainerinActionMenu.module.cssto ensure overlays do not exceed the viewport height.InsideDialogexample toActionMenu.examples.stories.tsxdemonstrating howActionMenucan be used interactively inside a scrollable dialog.Changed
ActionMenu.OverlayandAnchoredOverlaycomponents to accept a newdisplayInViewportprop, allowing overlays to be constrained within the viewport for better handling in dialogs and scrollable layouts.Removed
Rollout strategy
Testing & Reviewing
Merge checklist