question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[Modal] Scrollbar width is wrong when customized

See original GitHub issue

When you have a scrollbar style applied to body, the modal will break the design.

image

image

  • 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:

  1. Open https://codesandbox.io/s/material-demo-forked-74db5
  2. 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:closed
  • Created 3 years ago
  • Reactions:1
  • Comments:8 (7 by maintainers)

github_iconTop GitHub Comments

2reactions
Gautam-Arora24commented, May 19, 2021

@oliviertassinari Can I work on this issue?

2reactions
oliviertassinaricommented, May 8, 2021

@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:

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found