Skip to content
This repository has been archived by the owner on Apr 2, 2018. It is now read-only.

iOS 11 keyboardshow event not firing when switching from language to emoji keyboard #298

Open
SebastianSchirmer opened this issue Oct 16, 2017 · 3 comments

Comments

@SebastianSchirmer
Copy link
Contributor

SebastianSchirmer commented Oct 16, 2017

With iOS 11, an issue has popped up which we were not observing with previous iOS versions. There is no keyboardshow event fired anymore when the keyboard is open and its height changes.

The description of when this occurs is identical to the description I gave some time ago in this PR: #204

On iOS it is possible to select different keyboards when writing into form fields. E.g. an English keyboard, a German keyboard, and also the special built-in Emoji keyboard. If a user has enabled "Predictive" in his keyboard settings (Settings --> General --> Keyboard --> Predictive) then there is no issue with the current plugin code. However, if "Predictive" is turned off, a "language" keyboard has a different height than the "emoji" keyboard which is higher. This occurs if switching from one keyboard to another during inputting text. For example, a user starts typing using his English keyboard, then switches to the emoji keyboard to type some emoji. As the emoji keyboard has a different height (higher) than the English one (only if "Predictive" is switched off), the keyboardshow event does not fire at it did with iOS 10 and before.

Here are 2 screen videos illustrating the issue, the first one with option "Predictive" turned on, the second one with option "Predictive" turned off. The second one shows the erroneous behaviour.

1) "Predictive" turned on, correct behaviour

2) "Predictive" turned off, incorrect behaviour

@thessler27
Copy link

this is because that specific behavior is not supported in ionic-plugin-keyboard.... yet. the listener is just for when the keyboard is shown or hidden, not when the keyboard's frame is changed.

that said, I have submitted a PR here that listens for the UIKeyboardDidChangeFrameNotification which tracks specifically for that, and returns the new height at e.keyboardHeight.

evidently, iOS 11 is still being super annoying and not listening well for this when switching between keyboards as well as it should but that should be fixed in upcoming patches, i would assume. this is the correct way of listening for this event.

@thessler27
Copy link

it's also been recorded that this is an apple bug that they know about. so we have this implementation ready and wait for an OS update: http://openradar.appspot.com/radar?id=5026499329523712

@SebastianSchirmer
Copy link
Contributor Author

That may work, thank you!

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

No branches or pull requests

2 participants