Skip to content

Add overflow property to the overlay #6284

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

Merged
merged 2 commits into from
Jul 4, 2025
Merged

Add overflow property to the overlay #6284

merged 2 commits into from
Jul 4, 2025

Conversation

pksjce
Copy link
Contributor

@pksjce pksjce commented Jul 4, 2025

Closes #4938

https://www.loom.com/share/f2acc6235f6341b194376e98e0e4b711

Changelog

Fix the disappearance of overflow property in the Overlay component

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

I have described it in the loom video. Let me know if its relevant to add more testing

Merge checklist

@Copilot Copilot AI review requested due to automatic review settings July 4, 2025 02:48
@pksjce pksjce requested a review from a team as a code owner July 4, 2025 02:48
@pksjce pksjce requested a review from jonrohan July 4, 2025 02:48
Copy link

changeset-bot bot commented Jul 4, 2025

🦋 Changeset detected

Latest commit: 568568a

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 Patch

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 integration-tests: recommended This change needs to be tested for breaking changes. See https://arc.net/l/quote/tdmpakpm label Jul 4, 2025
Copy link
Contributor

github-actions bot commented Jul 4, 2025

👋 Hi, this pull request contains changes to the source code that github/github depends on. If you are GitHub staff, we recommend testing these changes with github/github using the integration workflow. Thanks!

Copy link
Contributor

@Copilot Copilot AI left a 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 restores the overflow prop support in the Overlay component by adding a corresponding data attribute.

  • Adds a data-overflow-… attribute based on the overflow prop
  • Ensures existing attributes (data-height-, data-max-height-, data-visibility-) remain unaffected
Comments suppressed due to low confidence (2)

packages/react/src/Overlay/Overlay.tsx:134

  • Add a unit or integration test to verify that passing an overflow prop (e.g., auto, hidden) correctly adds the corresponding data-overflow-… attribute.
          [`data-overflow-${rest.overflow}`]: rest.overflow ? '' : undefined,

packages/react/src/Overlay/Overlay.tsx:1

  • Update the component's documentation (props table, Storybook examples, or README) to include the new overflow prop and describe its effect on the overlay.
import type {ComponentPropsWithRef, ReactElement} from 'react'

@@ -131,6 +131,7 @@ export const BaseOverlay = React.forwardRef<HTMLDivElement, OwnOverlayProps>(
[`data-height-${height}`]: '',
[`data-max-height-${maxHeight}`]: maxHeight ? '' : undefined,
[`data-visibility-${visibility}`]: '',
[`data-overflow-${rest.overflow}`]: rest.overflow ? '' : undefined,
Copy link
Preview

Copilot AI Jul 4, 2025

Choose a reason for hiding this comment

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

[nitpick] For clarity, consider destructuring overflow from props alongside height, maxHeight, and visibility instead of accessing it via rest.overflow. This makes the prop usage more explicit.

Suggested change
[`data-overflow-${rest.overflow}`]: rest.overflow ? '' : undefined,
[`data-overflow-${overflow}`]: overflow ? '' : undefined,

Copilot uses AI. Check for mistakes.

Copy link
Contributor

github-actions bot commented Jul 4, 2025

size-limit report 📦

Path Size
packages/react/dist/browser.esm.js 92.67 KB (+0.28% 🔺)
packages/react/dist/browser.umd.js 92.55 KB (+0.01% 🔺)

@pksjce pksjce added this pull request to the merge queue Jul 4, 2025
Merged via the queue into main with commit ff6bf5c Jul 4, 2025
44 checks passed
@pksjce pksjce deleted the pk/overlay-overflow branch July 4, 2025 13:38
@primer primer bot mentioned this pull request Jul 3, 2025
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
Projects
None yet
Development

Successfully merging this pull request may close these issues.

ActionMenu with overflow doesn’t contain scrollbars within its rounded border
2 participants