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

Opening a Popover adds padding-right to the body element #28082

Closed
2 tasks done
MrOttimista opened this issue Sep 1, 2021 · 3 comments
Closed
2 tasks done

Opening a Popover adds padding-right to the body element #28082

MrOttimista opened this issue Sep 1, 2021 · 3 comments
Labels
component: Popover The React component. duplicate This issue or pull request already exists

Comments

@MrOttimista
Copy link

When I try to open any popover, a padding-right is added as a style for the body element
Why this is not the best way?

  1. it makes some components rerender
  2. some components is displayed in a messy way as shown in the example
  • The issue is present in the latest release.
  • I have searched the issues of this repository and believe that this is not a duplicate.

Current Behavior 😯

The padding-right is added as a style to the body element, please see the below photo

Photo: explain what happen when I open a popover

Expected Behavior 🤔

The padding-right is added as the scroll bar is hidden when I open the popover.
Suggestion:
how about disabling the scrollbar but keep it displayed Facebook does so

Steps to Reproduce 🕹

Steps:

  1. open popover docs => https://material-ui.com/components/popover/

  2. open the first popover

  3. before opening the popover
    popover-bug1

  4. After opening
    popover-bug2

Context 🔦

Your Environment 🌎

`npx @material-ui/envinfo`
  Don't forget to mention which browser you used.
  Output from `npx @material-ui/envinfo` goes here.
@MrOttimista MrOttimista added the status: waiting for maintainer These issues haven't been looked at yet by a maintainer label Sep 1, 2021
@MrOttimista MrOttimista changed the title Opening a Popover add padding-right to the body element Opening a Popover adds padding-right to the body element Sep 1, 2021
@mnajdova
Copy link
Member

mnajdova commented Sep 1, 2021

Duplicate of #19961

@mnajdova mnajdova marked this as a duplicate of #19961 Sep 1, 2021
@github-actions github-actions bot added duplicate This issue or pull request already exists and removed status: waiting for maintainer These issues haven't been looked at yet by a maintainer labels Sep 1, 2021
@github-actions github-actions bot closed this as completed Sep 1, 2021
@mnajdova mnajdova added the component: Popover The React component. label Sep 1, 2021
@MrOttimista
Copy link
Author

@mnajdova thank you for responding
Yes, it is duplicate and the answer was the behaviour is expected
but this behaviour causes a UI bug in the material ui offical web site
so, can you consider my suggested solution?

@loizosv
Copy link

loizosv commented May 21, 2024

This works for me but is causing other issues with scrolling while the popover is open.

<Popover disableScrollLock .... </Popover>

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component: Popover The React component. duplicate This issue or pull request already exists
Projects
None yet
Development

No branches or pull requests

3 participants