-
-
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
Dialogs cause the vertical scrollbar to disappear and reappear #6656
Comments
Are you sure this is not intended to be like that? |
Screen elements that jump around are a bad UI experience. For an example of how this could work better, see the Dialog in the react-md project: https://react-md.mlaursen.com/components/dialogs . In react-md, when a dialog appears the document's scrollbar is just disabled; it's not removed. This eliminates the jump. If you want to see what Google does, open an Android app that has a scrollbar and then open a dialog. You'll see that neither the background page nor the dialog jump. (E.g., in the Phone > Log screen). |
Another side effect for me was the page scrolling back to top whenever a dialog opened. As a workaround I've set |
We have fixed that issue on the v1-alpha branch by applying an extra padding to compensate the missing scrollbar width. We are following the bootstrap solution. Adding |
This is still happening for me (in the latest beta) when opening a dialog or even a Menu :/ |
I am also having this issue in the Dialog and the Popover component |
Same thing here, triggering Popover makes the whole page jump to the left due to |
I was having the same problem, but I've found a way to work around this by adding specific global styling to my index.html:
The overflow rules applies to the html element and overrides the modal rules. Dunno if this is ok though |
Let's move the discussing to #10000. |
I experienced the same problems working with Dialogs. The following is the only solution that I have tried that both removes the shifting of content and still locks the scroll of the underlying page/removes its scrollbar. Solution:
|
Setting the document's width to 100vw prevents this from happening: html {
height: 100svh;
width: 100vw;
overflow-y: scroll;
} |
Problem description
Every time a dialog appears (Dialog, Alert, Date Picker or Time Picker): if the document has a vertical scrollbar then it disappears, and reappears when the dialog is closed. This causes two annoying graphical glitches:
Link to minimal working code that reproduces the issue
This can be seen in the components demo. For example:
a) In the background, the GitHub icon in the top-right corner moves to the right when the Date Picker appears, and to the left when the Date Picker disappears.
b) When the dialog is closed, it jumps to the left before disappearing.
Related issues
I believe that the following issue has the same cause (I created a new issue in order to use the proper issue template):
#5977 [DatePicker & TimePicker] Why does the DatePicker and TimePicker shift a bit to the side when closed?
The text was updated successfully, but these errors were encountered: