ionic-framework icon indicating copy to clipboard operation
ionic-framework copied to clipboard

Android scroll stuck - cause related to keyboardPreventDefault in keyboard.js

Open alexbainbridge opened this issue 12 years ago • 38 comments

On Android 4.2, using Ionic Keyboard plugin (via Phonegap Build - currently pulling keyboard version 0.0.1)

Subsequent to any text entry in a form (e.g. a regular text input), and the keyboard hiding, the scroll won't go up or down

I fear that the version of the keyboard plugin available via Phonegap Build is not as current as available here.... and this problem may have been fixed (i.e. I can see a commit on the keyboard plugin that looks likely as a fix)

So a) Is the Phonegap Build version of the plugin being kept current at time of rapid change? b) Or have I found a new problem that is with beta 8 and nothing to do with the plugin?

(Once I know answer to a, I can help look into this and at least get to the point where the cause is known)

Thanks!

alexbainbridge avatar Jun 24 '14 23:06 alexbainbridge

@alexbainbridge unfortunately we don't control our own plugin because PGB allows people to submit plugins for repos they don't own. As far as I know however the plugin on PGB is up to date.

This definitely sounds like a bug though, would you mind putting together a simple codepen or plunkr that recreates the issue? Then we can take a look, thanks!

tlancina avatar Jun 24 '14 23:06 tlancina

Hi there Tim Is there a good way to create a demo for something that happens on device only? (ha, yeah, I think I know the answer to that!)

As for phonegap build - right now your plugin is listed twice.....

https://build.phonegap.com/plugins/793 Used for 2 apps using this one (someone else's fork) https://build.phonegap.com/plugins/785 Used for 62 apps using this one (a 2 month old tree)

Thats pretty chaotic I think!

If you follow link from 785 to Github, that goes to a specific version I think that hasn't been updated for 2 months (but I am not a Github expert at all, so could be misreading this)

Pretty sure the problem is Phonegap build versioning as otherwise I am sure the forums would be alight right now.....

alexbainbridge avatar Jun 24 '14 23:06 alexbainbridge

Yeah @tlancina I think your Android fixes (scroll, density) are post the 785 current version available via Phonegap Build

Not sure if those are exactly the bugs I have, but probably are.

I think you need to manage your own listing there :)

alexbainbridge avatar Jun 24 '14 23:06 alexbainbridge

@alexbainbridge someone submitted the plugin right after we released it, and re-submitting yields the error "A plugin already exists with that plugin id and version" unfortunately.

I wonder if we up the version number if it will auto-update? Not too familiar with Phonegap's plugin system.

tlancina avatar Jun 25 '14 00:06 tlancina

@tlancina I don't think it auto updates. I think you can "suggest" an update though, but only if you own the plugin...... best bet right now is to email the owner of 785 and ask them to request an update process to be initiated.....

alexbainbridge avatar Jun 25 '14 01:06 alexbainbridge

@alexbainbridge I know it might not be the answer you're looking for, but at this point I'd suggest e-mailing the plugin owner yourself if you'd like it updated, or taking it up with Phonegap, since it's not really an Ionic issue.

And who knows? Maybe in the near future you won't need to use Phonegap Build to build Ionic apps ;)

Also feel free to setup a codepen or some code we can put into a starter project reproducing the issue (sometimes it's easier to use the CLI and modify the starter templates for issues only on native) and we can take a look to see if it is an Ionic bug or just the outdated plugin.

tlancina avatar Jun 25 '14 15:06 tlancina

Well, right now there are 62 disappointed developers out there ;(

Personally I think you guys should email them, ask them to remove both the plugins, and you put your own in there, under your email credentials!

I will email the plugin owner though....

alexbainbridge avatar Jun 25 '14 16:06 alexbainbridge

Plugin owner says they will try to reassign ownership to yourselves..... perhaps you should email him too so that can be arranged!

(He is also going to do an update request too, hopefully, but I am not sure this is going to work unless the version number increases!)

alexbainbridge avatar Jun 25 '14 21:06 alexbainbridge

@alexbainbridge great I'll shoot him/her a note, thanks for looking into it!

tlancina avatar Jun 25 '14 21:06 tlancina

I just answered @tlancina on email. I will try to get an update request to PhoneGap and transfer ownership to Ionic team.

RagingRudolf avatar Jun 26 '14 06:06 RagingRudolf

(plugin owner here - along with RagingRudolf)

While we wait for the ownership transfer we will try to update the plugin on PhoneGap Build. However, I cannot find any documentation on how to start the update process. Perhaps the version specified in the plugin.xml needs to be incremented?

cbruun avatar Jun 26 '14 07:06 cbruun

Some info about plugin updates here http://community.phonegap.com/nitobi/topics/how_long_does_it_take_to_approve_plugin_updates

The first official reply in that thread seems to outline the process to be taken

alexbainbridge avatar Jun 26 '14 08:06 alexbainbridge

Thanks! Once the version number in plugin.xml has been incremented, I will try to update the plugin.

cbruun avatar Jun 26 '14 08:06 cbruun

@tlancina Can you please bump up the version number in the keyboard plugin (in plugin.xml) ? Thanks!

alexbainbridge avatar Jun 26 '14 08:06 alexbainbridge

Ok I just updated the plugin version. A big thanks to @casperbruun and @RagingRudolf for helping out with this, hopefully we can get the plugin transferred and save everyone this headache in the future.

tlancina avatar Jun 26 '14 13:06 tlancina

I have submitted 1.0.1 to PhoneGap Build.

It took around 20 days last time to get the plugin approved, might take a while again.

cbruun avatar Jun 26 '14 13:06 cbruun

Thank you @casperbruun

alexbainbridge avatar Jun 26 '14 14:06 alexbainbridge

Drum roll... It should be available on Phonegap build as we speak. I will still be working on ownership transfer.

RagingRudolf avatar Jun 27 '14 22:06 RagingRudolf

Great news everyone - thank you so much @RagingRudolf @casperbruun

This update seems to have fixed many of the problems I was experiencing with the keyboard, but not all of them.

I still have a scroll problem after text entry now but only on Android (the plugin fixed the IOS ones on tablets) ..... I am now going to try to work out whether its the plugin or something else (e.g. #1433 related as my test device is a Samsung )

alexbainbridge avatar Jun 28 '14 11:06 alexbainbridge

OK back to the original problem (the one remaining one).

Android Samsung Tab S3 Android 4.2.2 Ionic Keyboard plugin (!)

After text entry using the keyboard, scroll up and down is locked (and only restarts being scrollable when the app is closed / restarted)

I commented out from keyboard.js

keyboardShow: document.addEventListener('touchmove', keyboardPreventDefault, false); keyboardHide: document.removeEventListener('touchmove', keyboardPreventDefault);

And all works nicely now on the android device .

Hence seems there is an ionic cause / ionic solution here........ yay !

(solution may not be as simple as what I just did of course, as I am sure that that code is there for a reason, however I do know now that a solution is out there!)

alexbainbridge avatar Jun 28 '14 15:06 alexbainbridge