-
Notifications
You must be signed in to change notification settings - Fork 652
chore: ensure max-height does not surpass viewport height in Overlay, ActionMenu #7510
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
🦋 Changeset detectedLatest commit: c357d14 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 |
|
👋 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 |
Ensure that the max-height of Overlay and ActionMenu does not exceed the viewport height.
…eact into chore/fix-max-height-attributes
There was a problem hiding this comment.
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 updates overlay-like components in @primer/react to ensure their max-height constraints don’t exceed the viewport, and adds a Storybook example demonstrating scrollable overlay content when a max-height is applied.
Changes:
- Update
OverlayandActionMenumax-height size tokens to clamp against the viewport height. - Add a new
Overlayfeatures story demonstratingmaxHeight+ scrollable content. - Add story-only CSS for the new example’s layout.
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 4 comments.
| File | Description |
|---|---|
| packages/react/src/Overlay/Overlay.module.css | Clamp max-height size tokens against viewport height. |
| packages/react/src/ActionMenu/ActionMenu.module.css | Clamp ActionMenu container max-height size tokens against viewport height. |
| packages/react/src/Overlay/Overlay.features.stories.tsx | Add “SettingMaxHeight” Storybook example showcasing scrollable overlay content. |
| packages/react/src/Overlay/Overlay.features.stories.module.css | Add styles for the new scrollable-content story layout. |
|
@copilot open a new pull request to apply changes based on the comments in this thread |
|
@francinelucca I've opened a new pull request, #7519, to work on those changes. Once the pull request is ready, I'll request review from you. |
…iewport handling (#7519) Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: francinelucca <40550942+francinelucca@users.noreply.github.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
Copilot reviewed 6 out of 15 changed files in this pull request and generated 3 comments.
| const buttonRef = useRef<HTMLButtonElement>(null) | ||
| const confirmButtonRef = useRef<HTMLButtonElement>(null) | ||
| const closeOverlay = () => setIsOpen(false) |
Copilot
AI
Feb 10, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
confirmButtonRef is used as the ref for the close IconButton (and as initialFocusRef), which makes the name misleading in this story. Rename it to something like closeButtonRef/initialFocusRef to match its role.
| export const SettingMaxHeight = () => { | ||
| const [isOpen, setIsOpen] = useState(false) | ||
| const buttonRef = useRef<HTMLButtonElement>(null) | ||
| const confirmButtonRef = useRef<HTMLButtonElement>(null) | ||
| const closeOverlay = () => setIsOpen(false) |
Copilot
AI
Feb 10, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
SettingMaxHeight doesn’t accept Storybook args (notably open), so the e2e/VRT runner’s args: {open: true} won’t actually open the overlay for screenshots/a11y checks. Consider taking {open}: Args and rendering the overlay when isOpen || open (and align the useFocusTrap disabled condition accordingly).
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
|
@copilot open a new pull request to apply changes based on the comments in this thread |
|
@francinelucca I've opened a new pull request, #7522, to work on those changes. Once the pull request is ready, I'll request review from you. |
|
👋 Hi from github/github-ui! Your integration PR is ready: https://github.com/github/github-ui/pull/13256 |
This pull request improves the handling of maximum height for overlays and action menus, ensuring they never exceed the viewport height and remain usable on smaller screens. It also introduces a new story example demonstrating scrollable overlay content when the maximum height is reached.
Changelog
New
Changed
Rollout strategy
Testing & Reviewing
Merge checklist