-
-
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
[docs] Fix layout shift with modal #35591
Conversation
|
@@ -15,7 +15,7 @@ waiAria: https://www.w3.org/WAI/ARIA/apg/patterns/dialogmodal/ | |||
Unstyled Modal is a utility component that renders its children in front of a backdrop. | |||
This lets you create an element that your users must interact with before continuing in the parent application. | |||
|
|||
### Features | |||
**Features**: |
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.
**Features**: | |
### Features |
Would recommend reverting this, as this page structure is used in all base pages. We can discuss potential changes of the page structure in a dedicated PR.
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.
Oh, I actually started this PR by removing this H2 https://mui.com/base/react-modal/#customization and flatting the whole heading structure because it felt like it wasn't adding value. I mean, everything is about customization. e.g. How does it make sense to have "Performance" under "Customization"? But then I reverted to keep the changes focused.
@@ -126,6 +126,14 @@ In order to display an Unstyled Modal rendered on the server, you need to disabl | |||
|
|||
{{"demo": "ServerModal.js", "defaultCodeOpen": false}} | |||
|
|||
## Position fixed elements | |||
|
|||
The modal disables the page scrolling while open by setting the `overflow: hidden` CSS property on the relevant scroll container. |
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.
👍 nice I remember this mentioning on some pull request. It's nice to have now link to share.
Co-authored-by: Marija Najdova <[email protected]> Signed-off-by: Olivier Tassinari <[email protected]>
Fix https://mui-org.slack.com/archives/C041SDSF32L/p1671799892568439.
It's simpler to review the change without whitespace: https://github.com/mui/material-ui/pull/35591/files?diff=unified&w=1.
Before: https://mui.com/material-ui/react-select/#basic-select
Screen.Recording.2022-12-23.at.13.25.32.mov
After: https://deploy-preview-35591--material-ui.netlify.app/material-ui/react-select/#basic-select
The new docs: https://deploy-preview-35591--material-ui.netlify.app/base/react-modal/#position-fixed-elements. I wanted to document this since forever.