ionic-team / cordova-plugin-ionic-keyboard

Keyboard Plugin for Cordova
Other
192 stars 177 forks source link

Stop scroll to top of page after keyboard hides? #84

Open steveclarke opened 5 years ago

steveclarke commented 5 years ago

When the keyboard hides after input, my app is automatically scrolled to the top of the screen. I don't see an option to prevent this.

I replaced cordova-plugin-keyboard with this plugin, and that project had an option Keyboard.automaticScrollToTopOnHiding = false. Wondering if there's something similar?

I'm using version 4.0.1 with non-Ionic app. This solved all of my main keyboard issues with the Cordova app (thanks!) with the exception of this little annoyance.

steveclarke commented 5 years ago

Upon further investigation it looks like this only happens on iOS 12.x. Previous iOS works as expected and don't scroll to top of screen after keyboard is hidden/input loses focus.

ronanmcnulty commented 5 years ago

@steveclarke Did you manage to fix this issue?

steveclarke commented 5 years ago

No it's still happening for me.

YCMitch commented 5 years ago

Yeah, I'm getting the same with both this plugin and the standard cordova-plugin-keyboard one. No fix found as of yet.

YCMitch commented 5 years ago

Update: ironically, installing cordova-plugin-keyboard and setting Keyboard.automaticScrollToTopOnHiding to true kind of helps, in that it scrolls to the top, but then next render is back where it started.

I definitely wouldn't call it a solution though, and I have no idea why this isn't more widely reported. Eugh. Several days in, and I'm no closer to working out wtf is going on.

YCMitch commented 5 years ago

OH! Sorry about all the comments - I've worked this one out.

It's Ionic's WKWebview plugin - if you move back to Cordova's WKWebview instead, the annoying scrolling goes away.

steveclarke commented 5 years ago

That's not really an option for me. Ionic version is the only one that solves my UI rendering issue.

YCMitch commented 5 years ago

Why? All the our ionic plugins work okay.

jcesarmobile commented 5 years ago

By the comments, it looks like you are using cordova-plugin-ionic-webview, is that right? if so I think the bug is caused by it and not by the keyboard plugin. Can you provide a sample app so it can be reproduced? I can't reproduce on Ionic apps, and you mentioned you weren't using Ionic.

steveclarke commented 5 years ago

@jcesarmobile Yes I'm using Vue/Quasar with the cordova-plugin-ionic-webview plugin. I'll do up a repro sample app for you in the next couple of days.

YCMitch commented 5 years ago

It's certainly caused by Ionic webview - mine fixed immediately when moving to the generic Cordova WKWebview

timbru31 commented 4 years ago

Crossref to a potential issue on the webview repo: https://github.com/ionic-team/cordova-plugin-ionic-webview/issues/399

Gillardo commented 4 years ago

I am experiencing this issue as well, when will it be fixed?

sajallimbu commented 4 years ago

Any fix for it yet? I dont want to use default cordova wkwebview plugin cause of the local resource with file:// uri not being allowed which is fixed in ionic-wkwebview.