apache / cordova-ios

Apache Cordova iOS
https://cordova.apache.org/
Apache License 2.0
2.15k stars 987 forks source link

Keyboard still visible and stuck when coming from background #1098

Open sengewald opened 3 years ago

sengewald commented 3 years ago

Issue Type

Description

Information

When a keyboard is shown and the App is brought to background and back to foreground the keyboard is still shown even if no input field is selected. Also Keyboard.hide(); does not work.

Command or Code

Select an input field to show the virtual keyboard. Bring the App to the background. Maybe with a swipe from bottom to top. Bring the App back fo foreground. Keyboard is still visible but has no functionality anymore. Keyboard.hide(); does not work. When selecting an input field no keyboard input can be done. Keyboard does not react when changing orientation or selecting a "non" input field

While selecting back and forth between input and "non"-input field there is a chance of showing a "working" keyboard. Afterwards functionality is normal again. if there is no "non" input field app need to be closed and restarted

Environment, Platform, Device

IPAD IOS 14.4.1

Version information

Cordova 10.0.0

Checklist

sengewald commented 3 years ago

It seems to be a problem with newer IOS version.

Environment, Platform, Device IPHONE 6 IOS 12.5.2

Result I had no issues. Keyboard behavior was as expected.

I could also see a difference when looking at the tiles when in background. On IOS 12.5.2 i could clearly see the expanded keyboard at the bottom of the tile where on IPAD IOS 14.4.1 there was no keyboard shown in the tile.

2Prakash commented 2 years ago

Hi Guyz, Any update on this one??

sengewald commented 2 years ago

Hi @2Prakash, after an upgrade to cordova IOS platform version 6.2 the problem was fixed. After all the upgrade from IOS 5.x to 6.2 was not super difficult, just needed one more plugin.

If the App is already in production be aware that all local data need to be migrated due to the switch to WKWebView ion IOS 6.x

gary258796 commented 1 year ago

In my case, my app stuck when following below steps

  1. Click input field which will open keyboard .
  2. Receive SMS message , and make sure autofill function is open and enable so we should see the authentication code from the SMS message on the top of our keyboard.
  3. Bring the App to the background, and bring the App back to foreground.
  4. Click any numbers

Then the app stuck and not able to use anymore except we restart the entire app.

gary258796 commented 1 year ago

In my case, my app stuck when following below steps

  1. Click input field which will open keyboard .
  2. Receive SMS message , and make sure autofill function is open and enable so we should see the authentication code from the SMS message on the top of our keyboard.
  3. Bring the App to the background, and bring the App back to foreground.
  4. Click any numbers

Then the app stuck and not able to use anymore except we restart the entire app.

Just tested and have some result.

From tag 5.1.1 to 6.0.0, commit #773 switch UIWebView into WKWebView as default engine, then the problem disappeared. So i think is just bug in UIWebView.

And just for someone here later, if you are still using Cordova ios version below 6.0.0, you can follow instructions in cordova-plugin-wkwebview-engine by adding plugin and add one or two line config. For Cordova ios version above 6.0.0, you don't have to worry about since WkWebView is the default engine start from 6.0.0.