-
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
bug: ionic 1.0 / Native scrolling for Android makes keyboard hide input field #3727
Comments
This is really an issue. The keyboardFocusIn function in keyboard.js disables touch events after the keyboard is shown causing the scroll to 'freeze' if (!ionic.DomUtil.getParentOrSelfWithClass(e.target, 'overflow-scroll')) {
// any showing part of the document that isn't within the scroll the user
// could touchmove and cause some ugly changes to the app, so disable
// any touchmove events while the keyboard is open using e.preventDefault()
if (window.navigator.msPointerEnabled) {
document.addEventListener("MSPointerMove", keyboardPreventDefault, false);
} else {
document.addEventListener('touchmove', keyboardPreventDefault, false);
}
} But this only solves the frozen scroll problem. There's still the auto scroll to the focused input problem. // should be unnecessary in native scrolling, but keep in case bugs show up
self.scrollChildIntoView = NOOP; I'm trying to come up with something but it's kinda tricky In my opinion this is a major issue that renders native scroll impossible to use in production right now |
👍 There's also a post in the forum http://forum.ionicframework.com/t/keyboard-issue-with-ionic-v1-0-0/24907 |
Same issue with android L 5.1.1 |
Same issue here with android 5.1 (Nexus 5). |
Any solution to this? Will it be fixed in 1.0.1? I dont want to remove native scrolling because its too good :) |
Tobbe which version are you using?
|
@felquis 1.0.0 has the bug |
Yup I'm on 1.0.0 |
Native scrolling is the best new "feature" in the 1.0.0. |
Thanks, is this still in the nightly build? :/
|
@tlancina, you were looking in to something like this, right? |
Keyboard stuff relies heavily on JS scrolling, if you guys disable the Ionic keyboard code with |
@tlancina I will test it right now and let you know :) |
I tested with For information, I have this too: Tested on Ionic 1.0.0 release. |
I'have an urgency for this to be solved too: if i can help somehow? |
@jacargentina I've not found a fix or workaround yet... |
Hope this helps: debugging it seems that scrollChildIntoView is invoked, but it's neved executed for a given input |
ionic.views.ScrollNative does this:
I'm not aware on the differences on behaviour of having jsScrolling(true) vs. jsScrolling(false), but i think maybe in this case scrollChildIntoView should do the needed work? |
#3393 is a duplicate of this |
I haven't had the time to follow this and the forum's thread for a while now Please test this fix suggestion, and let me know if it solves the problem without causing others |
@lastikas It works, but have 2 little things to make it nicer:
|
If someone wants to post a minimal test case on codepen I'll take a look. scrollChildIntoView shouldn't be called if |
@tlancina Actually, when you set What we would like is to prevent an input text (at the bottom of the screen) to be hidden by the keyboard on click. |
@lastikas I think your code is very close to be the solution to this; if you had some time to fix the 2 observations i made before would be super! |
@tlancina I made a codepen http://codepen.io/felquis/pen/aOyYEZ/ --> to open in your phone http://s.codepen.io/felquis/debug/aOyYEZ I also created a repository git@github.com:felquis/scroll-bug-3727.git How to reproduce: Hope it help you. |
Hey Guys, So is this fixed? How can I get these changes on my current project? - Sorry a bit noob here and facing this issue. |
bower update ionic :) Make sure your bower.json targets Ionic's master branch. |
I testes it yesterday, there's a 1s delay on Android to start scroll to Also there's some warnings "forced synchronous renderings" But it's fixed. And works fine. I tried to save de timeline recorded with DevTools, but looks like there's
|
@felquis if it's an older Android device that's normal, since the actual web view doesn't report its correct size right away (and by right away I mean it takes upwards of 1s on some older devices) once the keyboard has opened. That "something huge" is quite possibly just the keyboard appearing. Thanks for profiling it, there is so much stuff happening it's a challenge to adjust for the keyboard coming up and still get scrolling at 60fps in a way that will work reliably and quickly across devices. If you're seeing significant lag on a modern Android device let me know or open a new issue with what device you're seeing it on and a simple codepen reproducing it and I'll take a look. |
Thanks @tlancina, I use Android 4.4.4, Moto X G1, chromium 33. It is probably faster in modern webviews :) |
Type: bug
Platform: android 4.4 webview
Using ionic 1.0 release and a basic form, when clicking on an input field, the keyboard is opened and hides all the input field. There's no automatic scroll.
It's annoying since the user can't even scroll at all (the screen is locked) to show the field.
The text was updated successfully, but these errors were encountered: