-
-
Notifications
You must be signed in to change notification settings - Fork 32.3k
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
Question: How to use material-ui react components with the Portal Pattern? #1675
Comments
I sense a case of XY Problem. |
Thanks @subjectix . I was about to try the "higher up component provide a showDialog" solution that you suggested but I thought I will ask here so that I can get your inputs. Thank You for your suggestions. Also, https://github.com/tajo/react-portal makes me think that the Portal Pattern is not only for non-reactive components. |
I see, I looked at react-portal. The thing about using portals for react components is that they aren't really designed with them in mind, especially those who rely heavily on contexts, even if material-ui does somehow patch that up so you can use the portal pattern, themes will surely give you trouble. I'd suggest your flow chart component to have that "method" of editing. This way even if you change your mind about modals (which I suggest you do) you can easily change your strategy. But... the "dialog doesn't work within absolutely positioned elements" issue would still need resolving :D |
#1621 I think this is the same issue in a different guise... portal/layer-mixin will work, you just need some magic to pass the context through... |
Also #1669 seems to be the same issue. |
Just noticed with #1669 - the transforms might be causing this because they're creating a new CSS stacking context... https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_Positioning/Understanding_z_index/The_stacking_context |
#1845 should resolve this |
addressed in #2129 |
While trying to show a dialog from an absolutely positioned div I faced some issues. Centering the dialog on the page with only CSS was not possible.
Also, the dialog uses
position:fixed;left:100%
which is fine when the Dialog is inside "body". But with my div, it ended up being invisible but draggable just to the left of my div.After some search, I found that the solution is to use the the Portal Pattern. But this gave me a lot of errors. (Warning: owner-based and parent-based contexts differ ) .
So, I was wondering if there is an example on how to use the material-ui Dialog with the Portal pattern.
Also, I apologize for not providing an example. I will recreate a scenario outside my project and link it here when I am done.
The text was updated successfully, but these errors were encountered: