[Modal] Scrollbar width is wrong when customized
See original GitHub issueWhen you have a scrollbar style applied to body, the modal will break the design.
- 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 😯
Design move always 16px.
Expected Behavior 🤔
Padding added should be the same size as the scrollbar.
Steps to Reproduce 🕹
Steps:
- Open https://codesandbox.io/s/material-demo-forked-74db5
- Click in Open Alert Dialog
Context 🔦
Trying to design a smaller scroll bar for a reading app.
Your Environment 🌎
`npx @material-ui/envinfo`
System:
OS: Windows 10 10.0.19042
Binaries:
Node: 12.16.2 - C:\Program Files\nodejs\node.EXE
Yarn: Not Found
npm: 6.14.4 - C:\Program Files\nodejs\npm.CMD
Browsers:
Chrome: 88.0.4324.190
Edge: Spartan (44.19041.423.0), Chromium (88.0.705.81)
npmPackages:
@material-ui/core: ^4.11.0 => 4.11.0
@material-ui/icons: ^4.9.1 => 4.9.1
@material-ui/lab: 4.0.0-alpha.56 => 4.0.0-alpha.56
@material-ui/styles: 4.10.0
@material-ui/system: 4.9.14
@material-ui/types: 5.1.0
@material-ui/utils: 4.9.12
@types/react: 16.9.34
react: ^16.13.1 => 16.13.1
react-dom: ^16.13.1 => 16.13.1
styled-components: ^5.2.1 => 5.2.1
Issue Analytics
- State:
- Created 3 years ago
- Reactions:1
- Comments:8 (7 by maintainers)
Top Results From Across the Web
jQUery UI dialog - modal creates scrollbars, wrong dimension?
On Internet Explorer 7-9pp and on mac firefox, chrome, safari and opera, the size of the modal background layer seems to be calculated...
Read more >scrollbar-width - CSS: Cascading Style Sheets - MDN Web Docs
The scrollbar-width property allows the author to set the maximum thickness of an element's scrollbars when they are shown.
Read more >How to deal with modals and scrollbars - UX Stack Exchange
This width change causes the content to re-flow slightly, both in the modal and page behind, on opening and closing the modal. Edit...
Read more >Body width increases when modal is opened #64 - GitHub
When the modal is open, it applies the "modal-open" class to the body tag. The "overflow:hidden" style makes the body width to increase....
Read more >Modal - Bootstrap
Use Bootstrap's JavaScript modal plugin to add dialogs to your site for lightboxes, user notifications, or completely custom content.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@oliviertassinari Can I work on this issue?
@danieljaguiar I can confirm the wrong behavior, I can also confirm that the proposed fix seems to work. Why not give it a try. I like how it might reduce the bundle size of the modal by simplifying the module. As a side note: