I am trying to stop the UI from scrolling up when focusing on an input. There is enough room for keyboard without scrolling. Any advice to stop this behavior? Can it be done on a screen by screen use case?
Before:
Not good:
Good:
I am trying to stop the UI from scrolling up when focusing on an input. There is enough room for keyboard without scrolling. Any advice to stop this behavior? Can it be done on a screen by screen use case?
Before:
Not good:
Good:
You can use the scrollAssist
option in IonicConfig.
IonicModule.forRoot({ scrollAssist: false }),
Though, there be dragons here due to how different devices handle input scrolling
I tried this (Ionic Vue) doing this and it didn’t work:
const app = createApp(App).use(IonicVue,{ scrollAssist: false });
(ionic 5)
I haven’t find any solution for this problem so I’m posting it here, only this workaround worked for me (Ionic Vue)
template:
<ion-content ref="pageContent">
// content
</ion-content>
script:
methods: {
disableInputScroll() {
this.$refs.pageContent.$el.scrollToPoint = function() {
return false
}
}
},
mounted() {
this.disableInputScroll()
}