-
-
Notifications
You must be signed in to change notification settings - Fork 7k
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
Remove overflow-y from html element #1197
Comments
For me the biggest problem with this is the shifting of the page content that occurs when opening a dialog, because the dialog removes the scrollbar entirely (or pushes it aside?). |
Yeah, I experienced the same thing with dialogs as well (navigation drawer too, etc.). I was assuming there is a reason for this, but perhaps there's a better way to achieve the same outcome than always persisting a scrollbar (main reason why I created this). |
The problem with this is there are just as many people who are already used to this. On top of that, a few points:
This has been brought up in the past, I just don't think it's difficult for a developer to just turn it off if they don't want it. |
|
I don't understand that last part. |
Isn't this the default behavior of nearly every page on the web? Generally speaking, the default for a scrollbar is almost always hidden unless the content requires it to be there. I definitely agree it's trivial for a dev to override, but it seems to be an odd default in my opinion, which is why I initially opened this issue. If this is indeed intended and the way you'd like to keep it, feel free to close this issue. Thanks :) |
@johnleider https://vuetifyjs.com/components/dialogs (open a dialog as an example) Navigation drawers, dialogs, and other components automatically have overflow hidden, so the current behavior (default being to force the scrollbar) actually causes that constant jarring with the viewport width jumping back and forth. |
After speaking with the backers and devs, the consensus is to leave it as it is and allow the user to change it. |
Hi, maybe we should include an example of how best to disable the scrollbar, for those who need it, as part of the FAQ. Presently, the FAQ Question:
has as this Answer:
The present answer does help those looking for HOW to disable the scrollbar |
There are a few ways to have the scrollbar added or removed adding this, and adjusting the width to 0, for example, will remove the scroll bar, then, if you want to add or remove a scrollbar within a container, you would add it to it specifically [https://www.w3schools.com/howto/howto_css_custom_scrollbar.asp] |
add vuetify to vue object add a style for html to remove overflow-y scroll ref: vuetifyjs/vuetify#1197
The problem is in the html element having the To remove the scrollbar add example: |
I can think of literally no "pros" to having And I agree that the lack of a standardized way of overriding this behaviour is a problem. What I ended up doing was adding the following to my
Which sucks, of course, because why is the framework forcing me to use |
This style brokes iframe default behavior, causing double scrolling bars, I had a lot of try-errors until I find this global style being the source of the problem. This behavior should not be default because of these kind of side-effects which are not visible. For anyone having the same issue: <template>
<iframe
frameborder="0"
src="..."
scrolling="no"
/>
</template>
<style>
html {
overflow-y: hidden !important;
}
</style>
<style scoped>
iframe {
position: fixed;
top: 0;
left: 0;
width: 100vw;
height: 100vh;
overflow: hidden;
}
</style> |
I don't see any reason to leave this in anymore, dialogs add padding to make up for missing scrollbars now:
|
Steps to reproduce
Use Vuetify.
Versions
Latest of everything.
What is expected ?
html
element to have nooverflow-y
set oroverflow-y: auto
What is actually happening ?
html
element hasoverflow-y: scroll
, which forces a scrollbar to always be present.Reproduction Link
https://codepen.io/anon/pen/JyXrNz
The text was updated successfully, but these errors were encountered: