New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.
Already on GitHub? Sign in to your account
[ModalManager] Dialog in Shadow DOM creates scroll jump #39636
Comments
@arminbashizade, thanks for the report. Would you like to create a PR with a fix? |
@michaldudak, I have encountered a similar problem as @arminbashizade. According to documentation, material-ui/packages/mui-base/src/unstable_useModal/ModalManager.ts Lines 125 to 139 in c9bef2c
The only way to solve the problem is to use @michaldudak, if |
We're not adding any new features to this version of @mui/base. We moved the development of the library to the new repo, and we're working on changing the components' API there. When we get to the Modal, we'll consider this issue. |
I have an issue when using LightGallery's carousel component along with MUI Dialogs on the same page, |
@TamirCode, please open a new issue and provide a reproduction. |
it seems to be an issue with lightgallery package rather than mui, my mistake. thanks |
Duplicates
Latest version
Steps to reproduce 馃暪
Link to live example:
https://stackblitz.com/edit/react-aj5fcw?file=index.tsx
Steps:
div
s to create overflowCurrent behavior 馃槸
when the dialog is opened in Shadow DOM the scrollbar is removed (
overflow: hidden
) however the space is not filled with a padding-right, as it is done for a dialog outside of shadow DOM, see the column of text on the right on the example:Expected behavior 馃
the scrollbar's width must be replaced with a padding-right
Context 馃敠
We use Shadow DOM to isolate styles for components we inject into other pages. We add a component on a long page that opens a dialog, but because its added in a Shadow DOM it doesn't replace the scrollbar width with padding so there's a jump on the page.
here's where I think the issue is happening in MUI:
In
ModalManager
isOverflowin
function returnsfalse
becausecontainer
is not the same asbody
and both itsclientHeight
andscrollHeight
are 0material-ui/packages/mui-base/src/unstable_useModal/ModalManager.ts
Lines 12 to 20 in 64c48b5
so
handleContainer
will not addpaddingRight
material-ui/packages/mui-base/src/unstable_useModal/ModalManager.ts
Lines 101 to 123 in 64c48b5
Your environment 馃寧
npx @mui/envinfo
this was tested in Chrome
The text was updated successfully, but these errors were encountered: