Skip to content
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

Closed
wants to merge 5 commits into from

Conversation

arizzitano
Copy link
Contributor

@arizzitano arizzitano commented Dec 11, 2017

Update Modal to render its element to a portal at the root of document.body. This:

  • makes styling easier (no risk of modal positioning conflicting with container positioning)
  • makes backdrop easier

TODO

  • make sure it doesn't break in SFE

outline-color: Highlight;
outline: -webkit-focus-ring-color auto 5px;
}
}
Copy link
Contributor Author

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);
Copy link
Contributor Author

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.

@arizzitano
Copy link
Contributor Author

Test failures are due to enzymejs/enzyme#1150, which looks pretty hairy tbh.

@arizzitano arizzitano changed the title refactor modal to use portals feat(modal): refactor modal to use portals Dec 12, 2017
@@ -1,3 +1,5 @@
import initStoryshots from '@storybook/addon-storyshots';

initStoryshots();
initStoryshots({
storyKindRegex:/^((?!.*?Modal).)*$/
Copy link
Contributor Author

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.

Copy link
Contributor Author

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.

@coveralls
Copy link

coveralls commented Dec 18, 2017

Coverage Status

Coverage decreased (-0.7%) to 98.864% when pulling 1c3f0f0 on ari/portal-modal into e55f193 on master.

@coveralls
Copy link

coveralls commented Dec 19, 2017

Coverage Status

Coverage decreased (-0.2%) to 99.318% when pulling 742f3b4 on ari/portal-modal into e55f193 on master.

@coveralls
Copy link

coveralls commented Dec 20, 2017

Coverage Status

Coverage decreased (-0.2%) to 99.318% when pulling 742f3b4 on ari/portal-modal into e55f193 on master.

@arizzitano
Copy link
Contributor Author

way out of date; closing in favor of @Mjloturco's (eventual) better solution

@arizzitano arizzitano closed this Mar 30, 2018
@abutterworth abutterworth deleted the ari/portal-modal branch March 20, 2019 20:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants