-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Dialog component scrollbar shift #882
Comments
Hi, This is entirely dependent on the user's layout. Adding padding* CSS can break the app of users Or the same behavior continues if any element such as topbar or footer has position: fixed. Therefore, Users can override p-overflow-hidden class according to their needs. We may use overflow: overlay instead of overflow: auto for such problems in the future. Not all browsers currently support this. https://caniuse.com/css-overflow-overlay Best Regards, |
You can just override with:
It still allow to user to scroll page, but no more shift and in modal mode i did not see how it can harm, because user can't click through overlay! |
Works perfectly! |
Hey all! I found a nicer solution:
With the scrollbar-gutter, the scrollbar is still locked and the layout shift is not there anymore! |
Reopening due to community feedback. In 3.35.0 blockScroll will help as well but a nicer solution is preferred. |
Affected components:
|
I have a layout that does not make use of body overflow and causes my page to shift like the issue describes. body.p-overflow-hidden {
--scrollbar-width: 0px !important;
} This will prevent the padding from being applied to the body as no scrollbar will ever appear in our body due to our layout. |
For anyone screwing this up like I just did, and seeing shifts in 3.37.0: make sure you don't set html, body {
margin: 0;
} rule and simply added body {
margin: 0;
scrollbar-guttern: stable;
} works. (Perhaps resetting margins on |
why its closed? the problem is still there |
When opening a modal Dialog, the scrollbar is removed which results in a 15px shift on the body
Expected Behavior
No shift when opening a modal
Current Behavior
With modal property set to true (adds
p-overflow-hidden
class in body), the scrollbar is removed which creates a 15px shift.Possible Solution
Steps to Reproduce
:modal="true"
Description
I'm suggesting to change the modal behaviour so that the shift induced by the scrollbar removal is no longer visible.
Possible Implementation
In
Dialog.vue
, when adding the'p-overflow-hidden'
class todocument.body
, also add a'p-pr-15'
class (padding-right: 15px;
) and remove it when removing the overflow classThe text was updated successfully, but these errors were encountered: