ionic-team / ionic-plugin-keyboard

Ionic Keyboard Plugin for Cordova
Apache License 2.0
610 stars 274 forks source link

keyboard height incorrect on ios #276

Open joshgarwood opened 7 years ago

joshgarwood commented 7 years ago

There's been a long standing issue in ionic with inputs and having the keyboard "active" on ios. My issue in particular is for a footer that always needs to be above the keyboard. Unfortunately ionic doesn't handle this by default on ios (it works wonderfully on Android though).

In an effort to fix it myself, I'm basically setting the "bottom" of the footer to be the "height" of the keyboard when it's active. Yet somehow, the footer is always above the keyboard. In looking at the keyboard plugin code, the line that calculates the height seems to be deprecated. Any ideas or insight would be helpful. My code is below:

 // TODO: Ugly hack to get the footer to sit above the keyboard when typing
        if (ConfigService.isIOS) {
            this.keyboard.onKeyboardShow().subscribe(kb => {                
                    this.footerBottomPosition = kb.keyboardHeight;
            });

            this.keyboard.onKeyboardHide().subscribe(kb => {
                this.footerBottomPosition = 0;
            });
        }

img_4372

R1Daneel commented 7 years ago

That space seem to be 20px equal to the height of the status bar. Is it possible that the calculation does not subtract the status bar height? I see other open bugs related to this issue

rockgabi commented 7 years ago

Did you fix the issue? Having the same problem...