cordova-plugin-ionic-keyboard icon indicating copy to clipboard operation
cordova-plugin-ionic-keyboard copied to clipboard

View not resizing on iOS

Open CharlieIGG opened this issue 6 years ago • 32 comments

Hi!

For some reason the view is not resizing on iOS for me.

I installed cordova-plugin-ionic-keyboard and I already have cordova-plugin-ionic-webview in my plugins.

I of course have the following in my config.xml:

    <preference name="KeyboardResizeMode" value="ionic" />
    <preference name="KeyboardResize" value="true" />

I also tried using native as the value for KeyboardResizeMode, all to no avail.

Any tips?

EDIT - funnily though I have another ionic project with the same config (AFAIK) and there resizing does work.

CharlieIGG avatar Jul 27 '18 17:07 CharlieIGG

Same issue here. Did you find what was causing this ?

Alex0x47 avatar Aug 01 '18 20:08 Alex0x47

+1 ... persistent issue

radulescuandrew avatar Aug 02 '18 10:08 radulescuandrew

So I keep getting this issue on and off. Today I got it again, and I was able to get this working by downgrading to an older version. I was using 2.1.5 IIRC, and forcing it to install 2.0.5 seems to have fixed this for me.

If you try this out, could you please validate whether it works for you @Alex0x47 @radulescuandrew ?

CharlieIGG avatar Aug 03 '18 23:08 CharlieIGG

Hi,

I found an other solution. I uninstalled this plugin, and added the other (deprecated ?) keyboard plugin (https://ionicframework.com/docs/native/keyboard/). Then added a few lines in app.modules.ts. So :

cordova plugin rm cordova-plugin-ionic-keyboard
ionic cordova plugin add ionic-plugin-keyboard && npm install --save @ionic-native/native-keyboard

In app.module.ts :

imports: [
		[...]
		IonicModule.forRoot(MyApp, {
			platforms: {
				ios: {
					scrollPadding: false,
					scrollAssist: false
				}
			}[...]
		}),
		[...]
	]

This is not a real solution, but I don't have time for this kind of bug.

Alex0x47 avatar Aug 04 '18 07:08 Alex0x47

+1 not resizing with <preference name="KeyboardResizeMode" value="ionic" />

supryan avatar Sep 21 '18 03:09 supryan

Thanks all for the info. We have a PR for a related bug and will try to get this one fixed as well

mlynch avatar Sep 21 '18 03:09 mlynch

Okay all, I need a little more information here because there's interplay between keyboard, webview, and ionic framework.

What versions of each are you all using?

Any repro case we can take a look at?

mlynch avatar Sep 21 '18 16:09 mlynch

I use: cordova-plugin-ionic-webview 2.1.4 cordova-plugin-ionic-keyboard latest and 2.0.5

<preference name="KeyboardResize" value="true" />
<preference name="KeyboardResizeMode" value="native" />

no way the webview is not resizing, the keyboard overlay content Maybe it's related with this: https://github.com/ionic-team/cordova-plugin-ionic-webview/issues/176

Stefano1964 avatar Sep 22 '18 13:09 Stefano1964

What version of Ionic?

mlynch avatar Sep 22 '18 13:09 mlynch

I dont use Ionic in this app

Stefano1964 avatar Sep 22 '18 13:09 Stefano1964

global packages: cordova (Cordova CLI) : 8.0.0

local packages: @ionic/app-scripts : 3.1.8 Cordova Platforms : android 7.0.0 ios 4.5.5 Ionic Framework : ionic-angular 3.9.2


cordova-plugin-ionic-webview 2.0.2 "cordova-plugin-ionic-webview" ionic-plugin-keyboard 2.2.1 "Keyboard"

I hope it will help.

Alex0x47 avatar Sep 22 '18 14:09 Alex0x47

Ionic: ionic (Ionic CLI): 4.1.2 Ionic Framework: ionic-angular 3.9.2 @ionic/app-scripts : 3.2.0

Cordova: cordova (Cordova CLI): 8.1.1 ([email protected]) Cordova Platforms: ios 4.5.5 Cordova Plugins: cordova-plugin-ionic-keyboard 2.1.3, cordova-plugin-ionic-webview 2.1.4

System: ios-deploy : 1.9.2 ios-sim: 5.0.3 NodeJS: v9.10.0 npm: 5.6.0 OS : macOS Xcode: Xcode 10.0 Build version 10A255

supryan avatar Oct 02 '18 15:10 supryan

Another to the list, No Ionic, Cordova 8.1.1, ios platform 4.5.5. UIWebView

Tried with WKWebView, although it seems to be working... ish, there are other issues there.

been banging my head against a wall for the last few hours. i assume same issue here.

https://github.com/cjpearson/cordova-plugin-keyboard/issues/77

seems to only be recent builds, i assume ios 12 sdk?

cokeeffekt avatar Oct 04 '18 08:10 cokeeffekt

I don't know obj-c but i beat it with a rock until i got something that fixes it, at-least in my use case. hope this helps

https://gist.github.com/cokeeffekt/08e43798890ccde032b76ab7c105adcf

cokeeffekt avatar Oct 04 '18 11:10 cokeeffekt

Just as a heads up, we don't support this plugin if you don't use Ionic. The reason is because Ionic Framework also has logic for keyboard interaction that you don't get without it. I'm not trying to force you to use Ionic but it's not as simple as just using this plugin. They both work together to achieve proper keyboard operation.

mlynch avatar Oct 04 '18 14:10 mlynch

So the above workaround of downgrading to 2.0.5 seems to have broken when using iOS 12. I know your post isn't probably directed to me @mlynch but I am indeed using Ionic.

CharlieIGG avatar Oct 05 '18 23:10 CharlieIGG

@mlynch

"cordova-plugin-ionic-webview": "^1.2.1",
"ionic-angular": "3.9.2",
"cordova-plugin-ionic-keyboard": "2.1.5",

And since of iOS 12 also with

"cordova-plugin-ionic-keyboard": "2.0.5", which formerly used to work fine.

CharlieIGG avatar Oct 08 '18 18:10 CharlieIGG

Hi team - I'm working with a community member who is having this issue. So far they're only seeing this behavior on devices running ios 12, and have been unable to reproduce on an emulator.

IonicProSupport avatar Oct 12 '18 14:10 IonicProSupport

giphy

supryan avatar Oct 19 '18 16:10 supryan

+1 Any solution?

noveweb avatar Feb 06 '19 22:02 noveweb

2019 and still is a problem...

samuelfaj avatar Mar 17 '19 06:03 samuelfaj

Indeed, fighting this for a day already. No solution yet.

dashko avatar Mar 25 '19 09:03 dashko

Downgrading has @Alex0x47 suggested is the only solution which worked for me

ndriJK avatar Apr 10 '19 01:04 ndriJK

That's a pity. Any news from the Ionic team? I already spent way too much time on this...

BigBerny avatar Apr 10 '19 03:04 BigBerny

I tried @Alex0x47 solution but I get the following errors:

npm WARN @ionic-native/[email protected] requires a peer of rxjs@^6.3.0 but none is installed. You must install peer dependencies yourself.
npm WARN @ionic-native/[email protected] requires a peer of @ionic-native/core@^5.1.0 but none is installed. You must install peer dependencies yourself.

What can I do?

BigBerny avatar Apr 19 '19 17:04 BigBerny

@CharlieIGG can you provide a sample app where the issue can be reproduced? I couldn't reproduce on a new Ionic 4 app.

For the rest of people commenting, specially to those not using ionic, <preference name="KeyboardResizeMode" value="ionic" /> only works on Ionic apps, so if you are using that preference it won't work in your apps. If you are not using that preference, then it's a different issue, report it in a new issue, and please, provide a sample app where it can be reproduced.

jcesarmobile avatar Aug 21 '19 17:08 jcesarmobile

"@ionic-native/keyboard": "^4.20.0", "cordova-plugin-ionic-keyboard": "^2.2.0", "cordova-plugin-ionic-webview": "^4.1.1",

View not getting resized, can we get a fix? Our app depends on this feature to work because we have a textarea in ion-footer the content is not getting pushed up like it's suppose to be.

yaozuwang avatar Sep 15 '19 03:09 yaozuwang

Strongly recommending that, I use below (viewport-fit is the issue, ignore my other settings like width height etc, or use as is)

<meta name="viewport" content="minimal-ui, user-scalable=no, initial-scale=1, maximum-scale=1, minimum-scale=1, width=320, height=device-height, viewport-fit=cover">

together with these, I also use cordova-plugin-statusbar and cordova-plugin-navigationbar-color for Android and cordova-plugin-webviewcolor for iOS, then I can set colors for top and bottom for both platforms (even transparent for ios and plugin also sets keyboard hue on iOS)

gdarcan avatar Feb 04 '20 09:02 gdarcan

@jcesarmobile sadly I missed your request and I'm just seeing this from a notification I got on the last comment.

I no longer have access to the repo where I had this problem. Where I left we had to lock-on to the older version.

I'm really hoping to never having to deal with Cordova ever again, plus I have nothing else I can contribute here, so I'm unsubscribing form this thread.

I'm hesitant to close the issue, given that it also seems to affect other people and no definitive solution has been given, but feel free to close it if it matches your house-keeping criteria @jcesarmobile

CharlieIGG avatar Feb 04 '20 10:02 CharlieIGG

+1 Hi, Since the issue still persist , i also faced a similar kind of issue .i will put it out here if it helps.

Resize keyboard is not working for IOS 13 (13.2 specially) i have tried with v 2.2.0 and 2.1.3 both. I have been using this plugin (v 2.1.3),but ever since IOS 13 is released its keyboard resize feature for IOS 13 is not working. I have tested on multiple devices , with both IOS 12.4 and 13.2, it works fine with 12.4 but breaks for 13.2 on the same device and keyboard covers the area of screen equals to its height. all fields and functions behind it are not accessible unless keyboard is closed.

irafayabdul avatar Jun 13 '20 06:06 irafayabdul