this is my first post on this forum, I hope I’m doing everything right.
I have been searching for solutions since a few days now, and have read probably all posts that have been made about this, but they all seem to only cover apps.
I have footers on many pages, simple ones like this:
Opening the keyboard (e.g. by selecting an ion-input) opens the keyboard without moving the view up, it justs hides it (Different behaviour than in app)
The footer gets moved up (Same as in app). This is wrong.
–> Solution: none found until yet.
–> Keyboard events do not trigger on a website, as it is a native library, and a website does not have native access.
–> I tried a lot of different options in css, but it really messes up a lot of things in either the web or the app or both.
My question:
How can I always keep the footer bottom, with the keyboard overlapping it if needed?
for ionic web, no solution currently exists. Unfortunately web is poorly supported in many ways, but at least it seems like its a focus for ionic in 2020, with their new ionic for web milestone.
For apps I still use the native keyboard plugin to detect when the keyboard is shown and then hide the footer.
With the update last week, it seems that their might be a solution for this, released with the latest release Ionic 5.1.0.
Here is the pull request: https://github.com/ionic-team/ionic/pull/18478
Documenation is not live yet.
I already tried it out, its done like this:
private subscribeToIonKeyboardEvents(): void {
this._platform.keyboardDidShow.subscribe(ev => {
// Do something with the keyboard height such as translating an input above the keyboard.
const { keyboardHeight } = ev.detail;
// Move input back to original location
this.$keyboardHidden.next(false);
});
this._platform.keyboardDidHide.subscribe(() => {
// Move input back to original location
this.$keyboardHidden.next(true);
});
}
The notes says it works for Chrome 62+ and iOS 13+, but i didn’t get events on mobile Chrome.
But still, a silver lining that it eventually will work on browsers.