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

[Modal] Padding added to the body when opening #19984

Closed
1 task done
TomPradat opened this issue Mar 4, 2020 · 4 comments
Closed
1 task done

[Modal] Padding added to the body when opening #19984

TomPradat opened this issue Mar 4, 2020 · 4 comments
Labels
component: modal This is the name of the generic UI component, not the React module! status: waiting for author Issue with insufficient information

Comments

@TomPradat
Copy link
Contributor

  • The issue is present in the latest release. (4.9.5)

I've search the issues and this is related to a lot of issues, including this one => #10000

Current Behavior 😯

In my application, I sometimes get a padding-right added to the body when a Modal is opened.

Steps to Reproduce 🕹

I haven't find a way to reproduce this yet and it happens randomly.

Your Environment 🌎

Tech Version
Material-UI v4.9.5
Browser Chrome v80
@TomPradat
Copy link
Contributor Author

So I've investigated on this behavior, and adding the following css fixes it :

html {
    overflow: hidden;
}

It's really weird and seems to be a problem with the navigator. Sometimes when rendering a modal, the html tag gets a scrollbar.

This causes the ModalManager to add a padding based on this scrollbar width => https://github.com/mui-org/material-ui/packages/material-ui/src/Modal/ModalManager.js

@TomPradat
Copy link
Contributor Author

TomPradat commented Mar 4, 2020

The scrollbar appears beetween the moment the modal is rendered and the moment when the opacity of this modal is set to 1. This causes the isOverflowing in the ModalManager to return true

@TomPradat
Copy link
Contributor Author

This is what happens in the sandbox from this comment.

I'm not sure what we should do about it though. Should we just provide the css fix in the documentation ?

@oliviertassinari oliviertassinari added the status: waiting for author Issue with insufficient information label Mar 6, 2020
@oliviertassinari
Copy link
Member

The issue has been closed because it does not conform to our issue requirements.
Please provide a full reproduction test case. This would help a lot 👷 .
A live example would be perfect. This codesandbox.io template may be a good starting point. Thank you!

@oliviertassinari oliviertassinari added the component: modal This is the name of the generic UI component, not the React module! label Apr 5, 2020
@oliviertassinari oliviertassinari changed the title Padding added to the body when opening a Modal [Modal] Padding added to the body when opening Apr 5, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component: modal This is the name of the generic UI component, not the React module! status: waiting for author Issue with insufficient information
Projects
None yet
Development

No branches or pull requests

2 participants