-
-
Notifications
You must be signed in to change notification settings - Fork 32.5k
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’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Spacing issues with fixed elements when used while having a open dialog #8710
Comments
I have noticed two issue. 1. With the AppBarI think that we should be adding the following style to box-sizing: border-box; // Prevent padding issue with the dialog and fixed positioned app-bar 2. With the fixed positioned elementYou should be adding the |
@oliviertassinari I have added classname 'mui-fixed' into the element I want to fixed but The text still not fixed. |
It happens when I have the scroll page... |
@toolaugh The |
@oliviertassinari I have a page with header is fixed position and the body is not. it can scroll. |
+1 |
@toolaugh if you dont mind having the scroll bar visible all the time, try add the following to ur css |
A new reproduction example would help us digging in the issue. |
@oliviertassinari the issue simply comes from the fact the menus, popover, select and dialogs add overflow: hidden and padding-right: 17 to ur page, so all different compoments move to the right, unless the component is fixed and has mui-fixed classname, I manage to fix the problem by removing mui-fixed from my fixed components and to the body overflow-y: scroll to the body of the page, however it is not an elegant solution. I dont see why you chose to have popovers, select and menus with overflow hidden, ideally in any page opening any of those should not touch the scroll bar. A good example, in my project I have many components with popovers ( anchororigin.vertical: bottom) if I open the popover near the bottom of the screen most of the content is not visible because of the overflow: hidden |
I'm in the processing of converting a very old/large codebase and there was some legacy CSS lingering around of the following: body ::-webkit-scrollbar{width:12px;} Something that stupid gave me the same side effects you describe above with shifting content. Maybe this helps someone in the future, maybe not. Solved my problems for Popover, though! |
I believe that there is connected issue - when page does not have scrollbar and dialog is opened, following style is added to body:
Which causes pages jump left by 33px. |
even |
October 2022. Problem still exist. A temporary solution may be: body {
padding-right: 0 !important;
} |
Expected Behavior
Their should be a method to compensate for the dialogs bahavior when it opens. The dialog remove the scroll bar when it opens. When the site contains fixed elements that causes the element to move slightly.
Current Behavior
I was not able to find a method to solve this issue with the current possibilities.
One way to solve the problem is to stop the removal of the scrollbar. This approach requires a way to diable the compensation in element like the AppBar etc.
The other method could be some kind of Component og props that allows the fixed element to compensate in the same way as the AppBar.
Steps to Reproduce (for bugs)
Context
I tried to have fixed tabs right below the AppBar. In order to do that i wrapped the tabs in a div and fixed it. After that i used flexbox to center the Tabs.
Your Environment
The text was updated successfully, but these errors were encountered: