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

IOS setFocus on input make screen jump #10257

Closed
llorenspujol opened this issue Jan 31, 2017 · 13 comments
Closed

IOS setFocus on input make screen jump #10257

llorenspujol opened this issue Jan 31, 2017 · 13 comments
Labels
ionitron: v3 moves the issue to the ionic-v3 repository

Comments

@llorenspujol
Copy link

llorenspujol commented Jan 31, 2017

Ionic version: (check one with "x")
[ ] 1.x
[x ] 2.x

I'm submitting a ... (check one with "x")
[ 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:
I have multiple inputs in a page, and I focus them manually every time using the setFocus() method. The problem is that when i do so, the page makes the correct scroll but when this scroll is finished it return to de no scroll position, is like something is cancelling the scroll. I have read a lot of issues of IOS keyboard and i still couldn't find exactly what the problem is.

In this gif is shown the current behaviour.
https://i.gyazo.com/53f5d32e166e3ef9929402bb6e9dc822.gif

Expected behavior:

Of course the current behaivour would be that when focusing the scroll stays stable.

@jgw96
Copy link
Contributor

jgw96 commented Jan 31, 2017

Hello, thanks for opening an issue with us, we will take a look into this.

@jgw96 jgw96 added needs: reply the issue needs a response from the user v2 labels Jan 31, 2017
@ricardojbertolin
Copy link

+1

@jgw96 jgw96 removed the needs: reply the issue needs a response from the user label Feb 2, 2017
@larssn
Copy link

larssn commented Feb 16, 2017

In your module, try adding the options:
IonicModule.forRoot(MyApp, { scrollAssist: false, autoFocusAssist: false }), to your forRoot.

@llorenspujol
Copy link
Author

Thank you @larssn , but I tried this and I got no result, in fact nothing changed. I've to notice that I have installed the ionic-keyboard-plugin in my app, and maybe the keyboard plugin autoScroll is making conflict with ionic scrollAssist. This is because if I disable the autoscroll from the plugin like this:

cordova.plugins.Keyboard.disableScroll(true);

This strange jump disapears, but when focusing between fields the scroll is not moved anymore, and the last field gets hidden... so with this I can solve one problem but I get another... I think that the problem is the conflict between the autoScroll from ionic and the autoScroll from the keyboard plugin, but really not sure at all.

@michaelyuen
Copy link

Off the top of my head, Ionic adds 300px of bottom padding to accommodate the keyboard. Looking at your gif, a guess is that the 'jump' is caused by this. You could probably debug and watch the DOM to see if that's it. Do you have styling to override this? If not, maybe try?

Curiously, I'm not sure why the 'disableScroll' method would have any affect on the 'jump'. From my understanding, what this does shouldn't have anything to do with the input autoscroll.

@krvajal
Copy link

krvajal commented Jun 7, 2017

Having the same issue


Your system information:

Cordova CLI: 6.4.0
Ionic Framework Version: 2.2.0
Ionic CLI Version: 2.1.18
Ionic App Lib Version: 2.1.9
Ionic App Scripts Version: 1.1.4
ios-deploy version: 1.9.0
ios-sim version: 5.0.13
OS: macOS Sierra
Node Version: v8.0.0
Xcode version: Xcode 8.2.1 Build version 8C1002

@skyserpent
Copy link

my iOS preview doesn't jump on inputs, but Android jumps on all inputs 😞

@nacimux
Copy link

nacimux commented Aug 13, 2017

Did you find any solution ?

@mino922
Copy link

mino922 commented Dec 8, 2017

Does anyone have a solution to this problem I am seeing this on iOS?

Here is the output of Ionic Info:
` @ionic/cli-utils : 1.19.0
ionic (Ionic CLI) : 3.19.0

global packages:

cordova (Cordova CLI) : 7.1.0

local packages:

@ionic/app-scripts : 2.1.3
Cordova Platforms  : android 6.3.0 ios 4.4.0
Ionic Framework    : ionic-angular 3.6.0

System:

Node  : v6.11.2
npm   : 2.15.12
OS    : macOS High Sierra
Xcode : Xcode 9.2 Build version 9C40b

Environment Variables:

ANDROID_HOME : not set

Misc:

backend : legacy`

@xuanranGit
Copy link

xuanranGit commented Jan 22, 2018

Pleace conside set style for input like this:
.input-cover{
position:static;
}
Hope it's useful

@AlokGupta007
Copy link

I am still facing the same issue. Please help to resolve, I have tried all above option.

@adamdbradley adamdbradley added the ionitron: v3 moves the issue to the ionic-v3 repository label Nov 1, 2018
@imhoffd imhoffd removed ionitron: v3 moves the issue to the ionic-v3 repository labels Nov 28, 2018
@Ionitron Ionitron added the ionitron: v3 moves the issue to the ionic-v3 repository label Nov 28, 2018
@ionitron-bot
Copy link

ionitron-bot bot commented Nov 28, 2018

This issue has been automatically identified as an Ionic 3 issue. We recently moved Ionic 3 to its own repository. I am moving this issue to the repository for Ionic 3. Please track this issue over there.

If I've made a mistake, and if this issue is still relevant to Ionic 4, please let the Ionic Framework team know!

Thank you for using Ionic!

@ionitron-bot
Copy link

ionitron-bot bot commented Nov 28, 2018

Issue moved to: ionic-team/ionic-v3#175

@ionitron-bot ionitron-bot bot closed this as completed Nov 28, 2018
@ionitron-bot ionitron-bot bot locked and limited conversation to collaborators Nov 28, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
ionitron: v3 moves the issue to the ionic-v3 repository
Projects
None yet
Development

No branches or pull requests