-
-
Notifications
You must be signed in to change notification settings - Fork 6.9k
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
[Bug Report] IOS: when long dialog scroll, background should not scroll issue #3875
Comments
Please follow the guidelines on how to report an issue. In particular, provide an example on www.jsfiddle.net (or a similar service) that reproduces the problem. If necessary, create a repository for us to clone with a minimal reproduction. repositories of actual projects will generally not be accepted . Thank you. |
https://vuetifyjs.com/en/components/dialogs |
I have confirmed on iOS 11 that this does happen in safari. It seems to occur when the browser items like the url bar and forward/back buttons appear. Happens on Chrome iOS as well. I think it has something to deal with the dialog reaching the top or bottom of its content and therefore scrolling/focusing the actual page below it to keep scrolling |
Here is the way how I "fix" it: beforeCreate Dialog beforeDestroy Dialog .noscroll
position: fixed
overflow-x: hidden
overflow-y: hidden |
The dialog is supposed to disable overflow when it's opened: vuetify/src/mixins/overlayable.js Lines 178 to 181 in dc9b296
I don't know how we can fix that if safari is somehow ignoring it. |
The key point: The class needs to be added to the "body" tag. |
stylus: code: |
It happens to me on iOS when dialog opens over stepper. |
It works for me https://stackoverflow.com/questions/26046373/iframe-scrolling-ios-8
|
Can also the issue as diagnosed by @Neo888888 and @chewy94, issue is specific to v-dialog on iOS+Safari and applying the below on v-dialog should fix it:
|
To expand on this, regarding the Dialog Form example, scrolling in the dialog works fine if you touch exactly between two v-text-fields, but when you touch on any v-text-field, the actual page focuses and scrolling occurs there instead of in the dialog. Is there any way to increase the priority of this bug? This is likely effecting a large percentage of the user base since it occurs across all iOS devices. I haven't been able to get any of the proposed solutions above to work properly. |
Hello, Any news about this issue ? Thank you in advance |
@Pchianes Buy me an iphone and I'll have a look |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
They closed my similar issue (#6353), so I thought I'd comment over here. v-toolbar and v-bottom-navbar also cause scrolling of the content area if those components are "fixed" . In that case there is no opportunity to turn off scrolling on the body because they don't become active. They are always active. I just wonder what the root problem is? What did Apple change that is causing this to happen? I had to resolve this in a similar way in a non-Vue/Vuetify app as well. Seems very janky. Oh... and maybe I missed it, but the navigation drawer does the same thing too. In fact, you can go to vuetifyjs.com on your iOS browser and the overlay area is scrollable when the menu drawer is open. |
Can some more of you iOS guys check if #6280 solves the problem? @daviesdoclc Scrolling on toolbars and bottom nav is meant to happen, your issue was closed because the navigation drawer uses the same mechanism as dialogs to prevent scroll on the body. As I noted in my previous comment, we do set overflow to hidden on mobile, so I have no idea why this is happening. |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
I have been reading through the comments and it sounds like this still hasnt been figured out yet. I've been working on getting my app up to speed with 2.0 and getting it into a cordova app and the first thing I noticed that was 110% broken was dialogs. I wrap the dialog component up in my own component so I can add a "scrollable" area for the default slot so the actions are always visible. As several have mentioned, if I touch/scroll from white space on the dialog, it works just fine, but initiating it from a text field or the actions area causes the whole body to scroll as well. I'm currently looking into using something like https://www.npmjs.com/package/body-scroll-lock but I would almost assume that vuetify should have issues like this handled natively 🤷♂ |
Hi, <template>
<v-dialog v-model="dialog" persistent scrollable>
<v-card class="dialogCard">
<v-card-title>
Dialog Title
</v-card-title>
<v-divider />
<v-card-text class="modal">
Dialog Contents (e.g. v-text-field)
...........
...........
</v-card-text>
<v-divider />
<v-card-actions>
<v-row justify="center px-5" align="center">
<v-col cols="6">
<v-btn block @click="close">
No
</v-btn>
</v-col>
<v-col cols="6">
<v-btn block @click="close">
Yes
</v-btn>
</v-col>
</v-row>
</v-card-actions>
</v-card>
</v-dialog>
</template> import { disableBodyScroll, clearAllBodyScrollLocks } from 'body-scroll-lock'
export default {
data: ()=>({
dialog: false
}),
methods: {
open(){
const modal = document.querySelector('.modal')
disableBodyScroll(modal)
this.dialog = true
},
close(){
clearAllBodyScrollLocks()
this.dialog = false
}
},
beforeDestory() {
clearAllBodyScrollLocks()
}
} <style lang="sass" scoped>
.modal
-webkit-overflow-scrolling: touch
.dialogCard
ovarflow-y: hidden
</style> |
@jameshhood We are most definitely looking for some help on this one if you have any advice. |
@johnleider I'm not sure I'd be the best person to ask about framework architecture lol but I'd almost recommend to pass a prop to v-content to allow your user base to determine whether or not they want to auto-apply these iOS only fixes. I mean obviously a framework cannot meet everyones expectations but with this being a very common css problem on iOS platforms, I would either add a 3rd party solution with documentation on how to use it or wrap up css functionality sort of like the print css classes y'all added. Mobile development is very tricky but a very demanding platform these days. I'd almost recommend having documentation section dedicated to how y'all recommend using your components on a mobile platform. |
I could not get this to work in an older (v1) cordova app with the above solution. |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
I use such a mixin for the full-screen dialogs that opens during scrollable content.
|
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
I understand the frustration with something you want resolved not being on the list of actionable items. Ideally we would be able to keep up with issues but this year has thrown a wrench into the plans. The last time I was in this thread, I asked for advice/help in solving the issue: #3875 (comment) . In addition, this issue has been marked as help wanted for a very long time and I really meant it when I selected that label. Rest assured, we will get this issue addressed; I appreciate everyone's patience and thank you for using Vuetify. |
@johnleider That is of course understandable, but this isn't merely something we "want resolved" — the message many of us have been trying to convey is that this bug makes |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
I'm not sure what issue you are seeing. Your example seems ok on iOS to me. I've been using my solution (#3875 (comment)) for quite a while in our iOS mobile app with success. |
Indeed, it's strange that this hasn't been fixed yet. For my use case, I was able to fix the long dialog over scroll with the following css:
Keep in mind that this isn't exhaustively tested, but feel free to check it out and it might work for you as well. |
I was able to prevent this issue by setting
|
Versions and Environment
Vuetify: 1.0.15
Vue: 2.5.13
Browsers: Safari 11.1
OS: iOS
Steps to reproduce
show a dialog with very long height. (NOT a full screen dialog)
Expected Behavior
the background should not scroll on IOS
Actual Behavior
the background scrolls sometimes
Reproduction Link
https://github.com/
Other comments
To fix this issue:
STYLUS:
.noscroll
position: fixed
overflow-x: hidden
overflow-y: hidden
The text was updated successfully, but these errors were encountered: