Skip to content
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

document.body height not being reset when keyboard closes after typing into multiple inputs #5

Open
joshmcrty opened this issue Mar 8, 2017 · 1 comment

Comments

@joshmcrty
Copy link

This looks like an issue with ionic-plugin-keyboard, but I thought it could be mitigated here.

I noticed that when entering text into an input and then closing the keyboard, everything works fine. But when entering text into an input, selecting another input, and then closing the keyboard, the body height stays small (as if the keyboard is still open).

I added a few console.log statements and noticed that the native.keyboardshow event is firing twice after the native.keyboardhide event when switching inputs. With the way ember-cordova-keyboard is coded to handle the body resizing, this._height is being reset to the initial body height, and then set to the calculated height because of the subsequent native.keyboardshow event that fires.

I think by just wrapping the line of code that sets this._height in a condition to check for isVisible this issue would be mitigated:

if (!this._keyboard.isVisible) {
  this._height = document.body.style.height || '';
}

Here is a screen capture of the issue:
cordova-keyboard-bug

@alexblom
Copy link
Member

Thanks for reporting. I'm going to give this a test as well, but if you have a working case you are more than welcome to PR. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants