-
Notifications
You must be signed in to change notification settings - Fork 1.3k
chore: Deprecate UNSTABLE_portalContainer in favor for PortalProvider #7976
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
Changes from 1 commit
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
15db448
Initial refactor to tear out UNSTABLE_portalContainer in favor of the…
LFDanLu e29a277
yarn.lock update
LFDanLu 72cec38
switch to deprecating UNSTABLE_portalContainer
LFDanLu b9b0995
prefer deprecated prop over context to make this a non-breaking change
LFDanLu 26a5f2f
add rough docs
LFDanLu bf0a29f
updating copy to include explaination of UNSTABLE
LFDanLu 580dbbb
rename to UNSAFE_PortalProvider
LFDanLu 0dd2ec9
update copy and split out example
LFDanLu f7b427c
Merge branch 'main' into refactor_to_use_portalProvider
snowystinger 8baed7a
use styles from RAC examples
LFDanLu File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -34,6 +34,13 @@ Modals, Popovers, Toasts, and Tooltips will portal their overlay element to. Thi | |||||
your app is already portalling other elements to a location other than the `document.body` and thus requires | ||||||
your React Aria components to send their overlays to the same container. | ||||||
|
||||||
Please note that `UNSTABLE_PortalProvider` is considered `UNSTABLE` because it is an escape hatch, and there are | ||||||
many places that an application could portal to. Not all of them will work, either with styling, accessibility, | ||||||
or for a variety of other reasons. Typically, it is best to portal to the root of the entire application, typically the `body` element, | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
outside of any possible overflow or stacking contexts. We envision `UNSTABLE_PortalProvider` being used to group all of the portalled | ||||||
elements into a single container at the root of the app or to control the order of children of the `body` element, but you may have use cases | ||||||
snowystinger marked this conversation as resolved.
Show resolved
Hide resolved
|
||||||
that need to do otherwise. | ||||||
|
||||||
## Props | ||||||
|
||||||
<PropTable links={docs.links} component={docs.exports.UNSTABLE_PortalProvider} /> | ||||||
|
@@ -89,7 +96,7 @@ function App() { | |||||
title: 'Toast complete!', | ||||||
description: 'Great success.' | ||||||
})}> | ||||||
Toast | ||||||
Open Toast | ||||||
</Button> | ||||||
</UNSTABLE_PortalProvider> | ||||||
<div ref={container} style={{height: '70px', width: '200px', overflow: 'auto'}}> | ||||||
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.