mui / mui/material-ui

[Drawer] Resizing window with open drawer makes main content non-scrollable

Open
#32,251 6 comments 2 reactions 1 assignee View on GitHub

@siriwatknp is already working on this.

Since Apr 13, 2022.

scope: drawer
Dominant language
JavaScript
Stars
99.1k
Forks
32.5k
Avg merge
2d 17h
Merged PRs (30d)
106

Description

Duplicates
  • I have searched the existing issues
Latest version
  • I have tested the latest version
Current behavior 😯

When switching the browser width between mobile & desktop, the main content is not any more scrollable.

Note that this not only happens when the viewport changes between mobile and non-mobile, but also when the Drawer is initialised with open = true state, but the viewport is in "desktop" width.

Expected behavior 🤔

Content is always scrollable, no matter if a Drawer has property open = true or not if Drawer is in "desktop" mode.

Steps to reproduce 🕹

Steps:

  1. Go to https://mui.com/material-ui/react-drawer/#responsive-drawer
  2. Resize window to "mobile" --> drawer is collapsed behind burger menu
  3. Click on burger menu --> drawer appears with gray backdrop, content disappears
  4. Reize window to "desktop" --> drawer stays visible on the left, and content re-appears on the right
  5. Now try to scroll the content. It doesn't work, as body has overflow: hidden; style. Also note that body has padding-right: 366px; style, which looks not good.
Context 🔦

No response

Your environment 🌎

Latest MUI version on Chrome.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.