Skip to content

[Modal] html overflow hidden issue #18336

@andreasheim

Description

@andreasheim
  • 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 😯

Our app uses Popover and Dialog components. They work correctly with v4.5.0. With 4.5.2 and 4.6.1 the exhibit strange behavior.

Popover: When opening, scrolls page to the top. When closing, scrolls down, but not quite to original position
Dialog: When opening, the page scroll is not removed, scrolls to top. When closing, page stays scrolled to top.

This uses the Popover for a custom dropdown.

Before opening, note how page is scrolled down:
Screen Shot 2019-11-12 at 10 39 56 AM

Now opened, page is scrolled up, Popover attached to bottom of the screen:
Screen Shot 2019-11-12 at 10 40 20 AM

Dialog not removing scroll when opened, and scrolled to top:
Screen Shot 2019-11-12 at 11 40 38 AM

Expected Behavior 🤔

  • Popover/Dialog should remove the scroll when opened, maintain the scroll position, and reset it when closed.

This is what we have in prod right now with 4.5.0

Before opening, page is scrolled down:
Screen Shot 2019-11-12 at 11 51 07 AM

When opened, page scroll is removed, Popover attached to the opening element:
Screen Shot 2019-11-12 at 11 51 17 AM

As dialog is opened, scrollbar is removed from the page, scroll position stays:
Screen Shot 2019-11-12 at 11 50 16 AM

Steps to Reproduce 🕹

I don't see this happening with the examples, so I'm not sure yet how to repro this outside our codebase.

Context 🔦

I want to update to the latest version of material-ui. This is blocking us.

Your Environment 🌎

Tech Version
Material-UI v4.5.2 v4.6.1
React 16.11.0
Browser Chrome 78
TypeScript N/A
etc.

Metadata

Metadata

Assignees

No one assigned

    Labels

    good first issueGreat for first contributions. Enable to learn the contribution process.scope: modalChanges related to the modal.type: bugIt doesn't behave as expected.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions