Skip to content

IOS setFocus on input make screen jump #10257

Closed

Description

@llorenspujol

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.

Activity

  1. jgw96 commented on Jan 31, 2017

    @jgw96
    Contributor

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

  2. added
    needs: reply
    on Jan 31, 2017
  3. ricardojbertolin commented on Feb 1, 2017

    @ricardojbertolin

    +1

  4. removed
    needs: reply
    on Feb 2, 2017
  5. larssn commented on Feb 16, 2017

    @larssn

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

  6. llorenspujol commented on Feb 16, 2017

    @llorenspujol
    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.

  7. michaelyuen commented on Apr 10, 2017

    @michaelyuen

    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.

  8. krvajal commented on Jun 7, 2017

    @krvajal

    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
    
  9. added 2 commits that reference this issue on Jun 12, 2017
    574ee31
    c10f72b
  10. skyserpent commented on Jul 19, 2017

    @skyserpent

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

  11. nacimux commented on Aug 13, 2017

    @nacimux

    Did you find any solution ?

  12. mino922 commented on Dec 8, 2017

    @mino922

    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`
    
  13. xuanranGit commented on Jan 22, 2018

    @xuanranGit

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

  14. AlokGupta007 commented on Jun 13, 2018

    @AlokGupta007

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

  15. ionitron-bot commented on Nov 28, 2018

    @ionitron-bot

    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!

  16. ionitron-bot commented on Nov 28, 2018

    @ionitron-bot

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

  17. locked and limited conversation to collaborators on Nov 28, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions