The Portal should create use something like MantineProvider's getRootElement by default
#8531
tzachyrm
started this conversation in
Feature requests
Replies: 2 comments
-
|
You can do that with default props – https://mantine.dev/theming/default-props/ |
Beta Was this translation helpful? Give feedback.
0 replies
-
|
Yes, this works! Thank you! |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
I'm building a library component that uses Mantine and want to keep the UI scoped within a specific DOM element.
getRootElementis very helpful, but Mantine is missing something similar for thePortalroot element. Currentlydocument.bodyis hard-coded.A workaround might be to pass
targetorportalPropsto every component that uses a portal, but that might get very challenging on large components. I suggest adding a centralized way to configure the default root element of the portal.Something like:
Beta Was this translation helpful? Give feedback.
All reactions