-
-
Notifications
You must be signed in to change notification settings - Fork 32.5k
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
[Popper] Allow setting default props in a theme #30118
[Popper] Allow setting default props in a theme #30118
Conversation
@DanailH @m4theushw Is this a feasible PR/approach? |
Thanks for your contribution. Your implementation seems to be working well. Could you, however, add a test to verify it? Does this resolve #30116? |
👋 The migration PR has been merged. Please follow these steps to make sure that the contents are all updated. (Sorry for the inconvenience)
If you are struggle with the steps above, feel free to tag @siriwatknp |
@hafley66 just a friendly ping. I faced the same issue you have with Shadow DOM. Do you have time to add the unit test @michaldudak requested? I think he wants to have a test similar to the one Modal component has https://github.com/mui/material-ui/blob/master/packages/mui-material/src/Modal/Modal.test.js#L57. |
Unfortunately, I have too many reasons to remove shadow dom (it is breaking selenium tests that are expecting iframes), so I can no longer spend time on this. Plus, recent changes in data grid are why I needed this, and there are other ways to solve Popper props there too |
…-portal-into-theme-inProps
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 added the test. Everything seems to be working well.
Thanks for the implementation!
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.
We need to update https://mui.com/components/popper/. This is no longer true:
https://bundlephobia.com/package/@mui/[email protected]
https://bundlephobia.com/package/@mui/[email protected]
For those that only care about the change, they can still use https://bundlephobia.com/package/@mui/[email protected]
So I think that we can update https://mui.com/components/popper/#unstyled too to mention the bundle size.
I realize now that its very difficult to add defaultProps for Portal, as its used by both modal and popper in base, so it wont inherit the default props.
It came as a surprise that its not possible to default the props for Portal, but I think everything either uses Modal/Popper/or Popover, which all have Portal props passed, so this would add ability to pass defaultProps to the Popper component and allow deeper defaulting
Closes #30116
Will not solve the portal issue, but I believe Popper is last component to not have defaultProps for container, so this will still cover the rest of the Portal'd elements.