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

Ionic2 long input form jumps to top on scroll down #5830

Closed
Yagger opened this issue Mar 14, 2016 · 2 comments
Closed

Ionic2 long input form jumps to top on scroll down #5830

Yagger opened this issue Mar 14, 2016 · 2 comments

Comments

@Yagger
Copy link

Yagger commented Mar 14, 2016

Short description of the problem:

On the mobile device only (not emulator or browser), if the list of input fields in long enough (so that you need to scroll it when keyboard is open), and the cursor in on one of the top fields, then scrolling down will cause the page to scroll back up and the cursor does some mysterious blinking through the fields.

What behavior are you expecting?

When scrolling down the list of input fields and given the cursor is somewhere on top, page should not scroll back to the field with cursor.

Steps to reproduce:

  1. Start the basic ionic2 app
$ npm install -g ionic@beta
$ ionic start BlankStarter blank --v2
$ cd BlankStarter
$ ionic serve
  1. Edit /path/to/BlankStarter/app/pages/home/home.html so that <ion-content> will contain the long list of <ion-item> with input.
  2. Upload the app to ionic view
  3. On your iPhone (6 plus in my case) open the app
  4. put the cursor in the first input field
  5. scroll down and note how cursor blinks though the fields and the the page jumps back to the field with set cursor. Very annoying and hard to manage.
<ion-navbar *navbar>
  <ion-title>
    Home
  </ion-title>
</ion-navbar>

<ion-content class="home">
  <ion-list>
    <ion-item>
      <ion-label fixed>Username</ion-label>
      <ion-input type="text" value=""></ion-input>
    </ion-item>
    ........copy/paste  <ion-item> 20 times or more..........
  </ion-list>
</ion-content>

Other information: (e.g. stacktraces, related issues, suggestions how to fix, stackoverflow links, forum links, etc)

Which Ionic Version? 1.x or 2.x
2.x

Run ionic info from terminal/cmd prompt: (paste output below)
Your system information:

Cordova CLI: 6.0.0
Gulp version: CLI version 3.9.0
Gulp local: Local version 3.9.1
Ionic Version: 2.0.0-beta.3
Ionic CLI Version: 2.0.0-beta.19
Ionic App Lib Version: 2.0.0-beta.9
ios-deploy version: 1.8.5
ios-sim version: 5.0.6
OS: Mac OS X El Capitan
Node Version: v5.3.0
Xcode version: Xcode 7.2.1 Build version 7C1002

@EvanWillms
Copy link

I have also seen this behavior on iOS and am currently using a workaround with a not-yet-documented Config flag for Components that disables the autoFocusAssist feature that works to put a focused input into the user's viewport. I've jotted down a little more information relevant to turing off the autoFocusAssist at:
https://forum.ionicframework.com/t/disable-scroll-ionic2-ios9-not-working/44847/5?u=evanwillms

When I deploy the same test case to Android devices, they automatically blur an input when it is manually scrolled out of the viewport, which releases focus and is my preferred behavior. iOS simulators and devices doggedly drag a focused input field back into the viewport, which is an unintuitive result and particularly frustrating in combination with #5020.

@jgw96
Copy link
Contributor

jgw96 commented Jun 13, 2016

Hello all, thanks for opening an issue with us. I will be closing as this has already been fixed as you can see from this issue: #5020. Thanks for using Ionic!

@jgw96 jgw96 closed this as completed Jun 13, 2016
@ionitron-bot ionitron-bot bot locked and limited conversation to collaborators Sep 8, 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

4 participants