Skip to content

[useScrollLock] overflow-y: scroll support no longer working #611

@oliviertassinari

Description

@oliviertassinari

Steps to reproduce

Steps:

  1. Go to https://master--base-ui.netlify.app/components/react-dialog/
Screen.Recording.2024-09-14.at.16.36.39.mov

Current behavior

Doesn't restore the value, it's overridden, so it introduces a layout shift.

Expected behavior

Correctly restore the previous values. For example https://github.com/mui/material-ui/blob/012c2e899b9a8977bb326746f43ef19a5f4f01a7/packages/mui-material/src/Modal/ModalManager.ts#L143 from https://mui.com/base-ui/react-modal/, it works.

Context

The support for overflow-y: scroll is needed to solve bugs like mui/material-ui#40749, until we can rely on #79.

Your environment

npx @mui/envinfo
  Don't forget to mention which browser you used.
  Output from `npx @mui/envinfo` goes here.

Search keywords: -

Metadata

Metadata

Assignees

Labels

component: dialogChanges related to the dialog component.type: regressionA bug, but worse, it used to behave as expected.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions