-
Notifications
You must be signed in to change notification settings - Fork 67
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
feat(modal): refactor modal to use portals #95
Conversation
outline-color: Highlight; | ||
outline: -webkit-focus-ring-color auto 5px; | ||
} | ||
} |
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.
The upstream patch for this merged!
if (!modalRoot) { | ||
modalRoot = document.createElement('div'); | ||
modalRoot.id = modalRootId; | ||
document.body.appendChild(modalRoot); |
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.
This doesn't feel quite right to me but I can't think of a low-API way to ensure the element exists in the DOM, outside the bounds of this component.
Test failures are due to enzymejs/enzyme#1150, which looks pretty hairy tbh. |
9fef2bf
to
1c3f0f0
Compare
@@ -1,3 +1,5 @@ | |||
import initStoryshots from '@storybook/addon-storyshots'; | |||
|
|||
initStoryshots(); | |||
initStoryshots({ | |||
storyKindRegex:/^((?!.*?Modal).)*$/ |
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 can't figure out how to make storyshots generate the modal snapshots without throwing, so I just skipped them for now. I don't think it negatively affects coverage.
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.
JK it does. Looking into it.
742f3b4
to
15f7042
Compare
way out of date; closing in favor of @Mjloturco's (eventual) better solution |
Update Modal to render its element to a portal at the root of
document.body
. This:TODO