-
Notifications
You must be signed in to change notification settings - Fork 13.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Android scroll stuck - cause related to keyboardPreventDefault in keyboard.js #1670
Comments
@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! |
Hi there Tim 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) 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..... |
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 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 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 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. |
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.... |
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 great I'll shoot him/her a note, thanks for looking into it! |
I just answered @tlancina on email. I will try to get an update request to PhoneGap and transfer ownership to Ionic team. |
(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? |
Some info about plugin updates here The first official reply in that thread seems to outline the process to be taken |
Thanks! Once the version number in plugin.xml has been incremented, I will try to update the plugin. |
@tlancina Can you please bump up the version number in the keyboard plugin (in plugin.xml) ? Thanks! |
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. |
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. |
Thank you @casperbruun |
Drum roll... It should be available on Phonegap build as we speak. I will still be working on ownership transfer. |
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 ) |
OK back to the original problem (the one remaining one). Android 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); 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!) |
Going to close this as it seems the issue has been resolved. |
@mhartington This isn't resolved actually My last comment was that I found the problem. I removed some code and yes it works, but presumably the code is there for a reason so removing it probably has an implication that I am not sure of ;) |
Okay, will reopen this. Not sure if this will help, but here is some info from out docs.
Let me know if any of this will help. |
The scroll becomes jammed subsequent to an edit (so its not around showing or not showing) However on another issue someone has suggested an android shim that may help (which I am going to look at). If that fixes it, I will close this one! |
@alexbainbridge, did that fix work? |
Sadly not - the only fix I know of is commenting out the two lines in the ionic code (as per the June 28 comment) (in keyboard.js) Is that code doing anything important? (ha, I hate that kind of question!). |
I had a look at this problem today and found some interesting behaviours that may help you guys find a way forward with regards to this issue. It seems that the events that fire when keyboards are shown / hidden are sometimes firing out of order and you end up with race conditions around setting / removing touchmove preventDefault event handlers. Example:
This leads to the events firing out of order: As you can see, the I had a play to see how I could 'unstick' the scroll and sure enough, if I trigger the Note: Since this is a race condition around those event handlers the only way i've been able to see it reliably reproduce is to go into an input field, as the keyboard is coming up I navigate away to another view by pressing the back button. When I console.log the event handlers I can see they are out of order, and sure enough the scroll will be stuck. |
@alexbainbridge. In my project I tried commenting out the the two lines which resulted in a fix for Android, however it raises problems on WP8. Probably a platform check for Windows will do. |
Any solution guys? I'm facing the same problem on Android phones. Open up the keyboard once or twice, and the vertical scrolling stops. |
@stil4m Yes device detection would be good there (maybe!) (not my area of expertise, Android issues) @mhartington Could this issue at least be labelled as an android issue - because then someone may spot it more easily. Seems several people have got this now (not just me) |
I'm not sure removing those 2 lines of code are good way of fixing this issue. You may end up regressing other things that those lines fix, I'm convinced it is the way how these events fire in conjunction with the keyboard showing / hiding that stuffs up things. It most likely needs a refactor to ensure they fire correctly and clean up the state of events when the keyboard closes. In the meantime, unless i'm completely wrong, you can try firing an event i.e.: |
I'm working to solve this, but haven't been able to recreate the issue. I've been testing on a Samsung Tab 3, with Android 4.1. Would someone be able to create a codepen, then describe exactly how to replicate the issue? I'm sure the issue is what @hydrogennz pointed out with events being out of order, but to correct them I'd like to be able to consistently recreate it. Thanks |
Interesting workaround idea on #2192 (its really just a version of what @hydrogennz suggested) More of a bandage than a cure, but may help some people |
This has been a challenge mainly because I've still been unable to reproduce. I've been testing on an Android 4.2, both browser and cordova, and running through all the scenarios described above and I'm still unable to replicate the stuck scroll. That said, I did attempt to clean up any areas which may be the source of the issue: 74de015 Would you be able to test your apps with the nightly version (#457 or above): http://code.ionicframework.com/#nightly thanks |
Thank you @adamdbradley . Seems to be better so that is great news. Will wait for others to feedback too (Reason I am not entirely confident is a test device I am using just auto-updated to android 4.4 in a similar timeframe - so I am not entirely sure what has fixed it - when I raised it, the test device was on 4.2) |
Going to call this closed. Please reopen and provide a codepen if you're still experiencing this issue. Thanks |
@alexbainbridge and @adamdbradley I am currently using this on 0.0.11 beta. I have just fixed it temporarily. Have a look at this : #2231 (comment) . It may help you in reproducing the issue. |
Thanks for the issue! This issue is being locked to prevent comments that are not relevant to the original issue. If this is still an issue with the latest version of Ionic, please create a new issue and ensure the template is fully filled out. |
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!
The text was updated successfully, but these errors were encountered: