-
Couldn't load subscription status.
- Fork 515
fix(portal): automatically nest portals if they are inside one another #2277
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
Pull Request Test Coverage Report for Build 3151
💛 - Coveralls |
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.
Sounds good! Great job with that! Just leaving a few comments before you go. Weird our coverage dropped by over 8%.
packages/clay-shared/src/Portal.tsx
Outdated
| } | ||
| > = ({children, containerRef, subPortalRef}) => { | ||
| const parentPortalRef = useContext(ClayPortalContext); | ||
| const portalRef = useRef(document.createElement('div')); |
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.
You can check if there is document here, I was having problems with it because it was being rendered on next.clayui.com and was breaking the site build (log https://app.netlify.com/sites/next-clayui/deploys/5d5595f8912d82502b05f511), because at build time there is no document.
typeof document !== 'undefined' && document.createElement('div')
tsconfig.json
Outdated
| "baseUrl": ".", | ||
| "paths": { | ||
| "@clayui/*": ["node_modules/@clayui/*/src"], | ||
| "@clayui/*": ["packages/clay-*/src"], |
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.
Have you ever tested if this works well? by running yarn build on packages and checking if the lib folder is being generated correctly with types.
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.
oh my bad, I didn't mean to include this. This was the previous code before you updated it because I was running into issues.
|
@matuzalemsteles yeah I was confused how coverage dropped. Maybe because this is the first test inside of |
Oh yeah, you're right about that. We can work later on adding tests to the other files from |
|
@matuzalemsteles also, I just updated the PR. Let me know if there is anything else you notice. |
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.
LGTM!
4342844 to
3ac4eaa
Compare
Added two new APIs to our portals. One is a target for nested portals, and the other is to render the portal to a specific element. By default portals now nest in one another as well.
this fixes #2246