-
Notifications
You must be signed in to change notification settings - Fork 955
fix(dialog): scrollbar Flash on opening #5121 #5802
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
base: main
Are you sure you want to change the base?
fix(dialog): scrollbar Flash on opening #5121 #5802
Conversation
dialog/internal/_dialog.scss
Outdated
@@ -173,7 +173,7 @@ | |||
// space from appearing on platforms that reserve scrollbar space. | |||
// Note: we only scroll vertically. Horizontal scrolling should be handled | |||
// by the content. | |||
overflow-y: scroll; | |||
overflow-y: auto; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If I understand correctly, this works by not forcing the scrollbar to show (auto
vs scroll
) if we detect overflowing content in JS and add the .scrollable
class?
What is the advantage to this solution as opposed to addressing the issue in JS that results in an inaccurate toggling of the .scrollable
class?
For example, toggling the class after open animations have settled as suggested in #5121 (comment).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, you understand correctly.
I suppose ive always been drilled on doing css over js but I can see your point, especially since there are open and close methods already.
Will do this in js 👍
dialog/internal/_dialog.scss
Outdated
@@ -185,6 +185,7 @@ | |||
font-weight: map.get($tokens, 'supporting-text-weight'); | |||
height: min-content; // Needed for Safari | |||
position: relative; | |||
overflow-y: clip; // Needed for .scrollable .scroller |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why is overflow-y: clip
vs the default overflow-y: visible
needed for the scroller?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not too sure on that actually... .content overflows when scroller is set to auto, so this prevents that. This would make more sense in a .scrollable > .content but as mentioned above ill go do this in js
This prevents the scrollbar from flashing (Chromium) as mentionend in #5121