-
Notifications
You must be signed in to change notification settings - Fork 127
Add Portal component #3107
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?
Add Portal component #3107
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
andrewzamojc
left a comment
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.
I'm just curious about the positioning props on the portal.
| usePortal?: boolean; | ||
| scrollContainer?: string; | ||
| flipOnCollision?: boolean; | ||
| hideWhenAnchorHidden?: boolean; |
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.
We might not need the last two props. Menu probably always wants to flip and hide when anchor is hidden?
| </ul> | ||
| </Portal> | ||
| {:else} | ||
| <ul |
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.
Could make a snippet of this ul, so it's not repeated. I see the style attribute is different, but that could be a param to the snippet.
| let { | ||
| anchor, | ||
| open = true, | ||
| position = 'bottom', |
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.
Is this mixing concepts between portal and overlay? I haven't gone this deep on portals but I didn't think they had a position like a popover...
|
This is great stuff! Pretty cool to see the guts of a Portal. |
Description & motivation 💭
This PR introduces a new
Portalcomponent to the Holocene design system and integrates it with the existingMenucomponent via an opt-inusePortalprop.Portalrenders children at a specific position relative to an anchor element with advanced positioning features:document.bodyto escape overflow/z-index constraintstop,bottom,left,right,top-left,top-right,bottom-left,bottom-right)flipOnCollisionis enabledscrollContainerprophideWhenAnchorHiddenis enabledScreenshots (if applicable) 📸
Design Considerations 🎨
Testing 🧪
How was this tested 👻
Steps for others to test: 🚶🏽♂️🚶🏽♀️
Checklists
Draft Checklist
Merge Checklist
Issue(s) closed
Related to
DT-3325Docs
Any docs updates needed?