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

[docs] Fix layout shift with modal #35591

Merged
merged 3 commits into from Dec 26, 2022

Conversation

oliviertassinari
Copy link
Member

@oliviertassinari oliviertassinari commented Dec 23, 2022

Fix https://mui-org.slack.com/archives/C041SDSF32L/p1671799892568439.

When you click on the menu, you'll notice the FAB at your right hand side of the right drawer shifts position. And the scroll bar on the right hand side appears and disappears. I'm also having this same issue in an app I'm building for a client, and the client is not happy about it. Menus and right hand drawers do not like each other

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.

@oliviertassinari oliviertassinari added bug 🐛 Something doesn't work docs Improvements or additions to the documentation labels Dec 23, 2022
@mui-bot
Copy link

mui-bot commented Dec 23, 2022

Messages
📖 Netlify deploy preview: https://deploy-preview-35591--material-ui.netlify.app/

No bundle size changes

Generated by 🚫 dangerJS against 49d424b

@@ -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**:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
**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.

Copy link
Member Author

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.
Copy link
Member

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.

oliviertassinari and others added 2 commits December 26, 2022 12:22
Co-authored-by: Marija Najdova <mnajdova@gmail.com>
Signed-off-by: Olivier Tassinari <olivier.tassinari@gmail.com>
@oliviertassinari oliviertassinari merged commit 7256d4a into mui:master Dec 26, 2022
@oliviertassinari oliviertassinari deleted the fix-fab-shift branch December 26, 2022 17:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug 🐛 Something doesn't work docs Improvements or additions to the documentation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants