-
Notifications
You must be signed in to change notification settings - Fork 622
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
Conversation
🦋 Changeset detectedLatest commit: 568568a 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 depends on. If you are GitHub staff, we recommend testing these changes with github/github using the integration workflow. Thanks! |
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 restores the overflow
prop support in the Overlay
component by adding a corresponding data attribute.
- Adds a
data-overflow-…
attribute based on theoverflow
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 correspondingdata-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, |
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.
[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.
[`data-overflow-${rest.overflow}`]: rest.overflow ? '' : undefined, | |
[`data-overflow-${overflow}`]: overflow ? '' : undefined, |
Copilot uses AI. Check for mistakes.
size-limit report 📦
|
Closes #4938
https://www.loom.com/share/f2acc6235f6341b194376e98e0e4b711
Changelog
Fix the disappearance of
overflow
property in theOverlay
componentRollout strategy
Testing & Reviewing
I have described it in the loom video. Let me know if its relevant to add more testing
Merge checklist