Skip to content
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

screen bounces when focusing inputs in a scrolling ion-content (web) #9346

Closed
macool opened this issue Nov 25, 2016 · 3 comments
Closed

screen bounces when focusing inputs in a scrolling ion-content (web) #9346

macool opened this issue Nov 25, 2016 · 3 comments

Comments

@macool
Copy link

macool commented Nov 25, 2016

Ionic version:
[x] 1.x
[ ] 2.x

I'm submitting a ...
[x] bug report
[ ] feature request
[ ] support request => Please do not submit support requests here, use one of these channels: https://forum.ionicframework.com/ or http://ionicworldwide.herokuapp.com/

Current behavior:
Switching betwen inputs inside an ion-content causes screen to awfully "bump". See example:

ionic-scrolling-bounces-before-patch

Expected behavior:
js scrolling helps me showing the form in the right place - however the screen shouldn't be bumping that way

Steps to reproduce:
switch between inputs inside a scrolling ion-content

http://plnkr.co/edit/FTIXiTalIrkNyYfwl25H?p=preview

unfortunately I can only see the issue in actual mobile devices via web - not in desktop web

-->

Related code:

insert any relevant code here

Other information:
I managed to workaround the native version by disabling the keyboard scrolling using keyboard plugin. However been fighting with the web version and there seem to be some discussion around this already. eg #2256 & #2285 seem to be related.

I haven't had much time myself to look at the details but it all seems to be happening here: https://github.com/driftyco/ionic/blob/v1.3.2/js/utils/keyboard.js#L143 where we debounce the focus for the current input. While placing some debuggers I realised I can patch it by wrapping it inside a function, so my best guess is it's losing the context and therefore performing the focusing several times:

var debouncedKeyboardFocusIn = function() { ionic.debounce(keyboardFocusIn, 200, true) };

and it works like charm:

ionic-scrolling-bounces-after-patch

Ionic info:

Your system information:

Cordova CLI: 5.4.0
Gulp version:  CLI version 3.9.0
Gulp local:   Local version 3.9.1
Ionic CLI Version: 1.7.15
Ionic App Lib Version: 0.7.2
ios-deploy version: Not installed
ios-sim version: 5.0.11
OS: Mac OS X El Capitan
Node Version: v0.12.5
Xcode version: Xcode 8.1 Build version 8B62
@jgw96
Copy link
Contributor

jgw96 commented Dec 12, 2016

Hello @macool ! Thanks for opening an issue with us! Would you mind trying the latest nightly (npm install ionic-angular@nightly --save) and trying again? I am not able to reproduce this with the latest nightly

@jgw96
Copy link
Contributor

jgw96 commented Jan 13, 2017

This issue was moved to ionic-team/ionic-v1#63

@ionitron-bot
Copy link

ionitron-bot bot commented Sep 5, 2018

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.

@ionitron-bot ionitron-bot bot locked and limited conversation to collaborators Sep 5, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants