Skip to content

issue(forms): Input, scrolling, keyboard issues for forms #6228

Closed

Description

@dylanvdmerwe

Right now, the way Ionic handles form input can be better. Ionic 1 had awesome defaults for form inputs with regards to keyboard handling, content scrolling, etc. Ionic 2 needs to be made consistent, and more importantly, work properly for form inputs consistently across all platforms (iOS, Android, Windows).

See this repo for the code example which should be run on devices: https://github.com/dylanvdmerwe/ionic2-formtest

Android:

  • 1. When selecting an input the entire form content should be scrolled so that the selected item is visible after the keyboard is displayed.
  • 2. When the keyboard is hidden, set the scrolling back to it's original position and remove added padding.
  • 3. Touching an area that is not an input dismisses the keyboard.
  • 4. If the user selects a second input after filling in the first one, the screen should be scrolled to focus on the newly selected input field.
  • 5. Some keyboards have a next, previous and done button. These should be hooked into the form inputs on the page in order to allow the user to cycle through the input options. [unable to test as cannot get a keyboard with next and prev buttons]
  • 6. Support for autocorrect, autocomplete & autocapitalize and combinations thereof.

iOS:

  • 1. When selecting an input the entire form content should be scrolled so that the selected item is visible after the keyboard is displayed.
  • 2. When the keyboard is hidden, set the scrolling back to it's original position and remove added padding.
  • 3. Touching an area that is not an input dismisses the keyboard.
  • 4. If the user selects a second input after filling in the first one, the screen should be scrolled to focus on the newly selected input field.
  • 5. Some keyboards have a next, previous and done button. These should be hooked into the form inputs on the page in order to allow the user to cycle through the input options.
  • 6. Support for autocorrect, autocomplete & autocapitalize and combinations thereof.

Note that this issue has nothing to do with forms or inputs in a slides component. That would be a seperate consistency check to perform.

Which Ionic Version? 2.x

Run ionic info from terminal/cmd prompt: (paste output below)
Cordova CLI: 6.1.1
Ionic Framework Version: 2.0.0-beta.4-201604170622
Ionic CLI Version: 2.0.0-beta.24
Ionic App Lib Version: 2.0.0-beta.14
OS:
Node Version: v5.7.0

Activity

  1. adamdbradley commented on Apr 19, 2016

    @adamdbradley
    Contributor

    @dylanvdmerwe This is great, thanks for putting this together! As for using the next and previous buttons to tab up and down the inputs, this should be working but maybe something broke recently.

    Also goes for auto complete and auto correct, by default they are disabled unless they are specifically added onto the element: https://github.com/driftyco/ionic/blob/2.0/ionic/components/input/input-base.ts#L217

    Do you think auto capitalization should be disabled by default too?

  2. self-assigned this
    on Apr 19, 2016
  3. dylanvdmerwe commented on Apr 19, 2016

    @dylanvdmerwe
    ContributorAuthor

    @adamdbradley

    • I cannot get the keyboard buttons on iOS to shift between the various inputs. They get "confused" and the keyboard eventually just closes. Still need to test on Android when I test with other keyboards that have these buttons.
    • Not sure what is best for the defaults for auto complete and auto correct. In iOS for certain keyboard types they are enabled by default - but I think it's best to follow standard <input> rules?
    • I will test some permutations for auto complete and auto capitalization a bit later. Note I logged this separately here when the keyboard plugin changed.

    Please note I am testing these on actual devices.

  4. dylanvdmerwe commented on Apr 20, 2016

    @dylanvdmerwe
    ContributorAuthor

    @adamdbradley I have updated the items above. Things outstanding are definite reproduceable issues.

  5. kevinATglympse commented on May 4, 2016

    @kevinATglympse

    Where are we on Android issue #1? It's totally messing up my app without it.

  6. layton-glympse commented on May 4, 2016

    @layton-glympse

    +1 on Android issue #1 :)

  7. dylanvdmerwe commented on Jun 4, 2016

    @dylanvdmerwe
    ContributorAuthor

    Any movement on the items listed in this issue?

  8. manucorporat commented on Jun 4, 2016

    @manucorporat
    Contributor

    @dylanvdmerwe once next beta is release (beta8) we will focus on fixing issues like this. Excuse the inconveniences

  9. added this to the 2.0.0-beta.9 milestone on Jun 6, 2016
  10. 113 remaining items

  11. ykulynych commented on Mar 21, 2018

    @ykulynych

    Hi guys, I accidentally found that default build has cordova-plugin-ionic-keyboard. And when I replaced it by ionic-plugin-keyboard input bugs have gone.

    So my solution is:
    cordova plugin rm ionic-keyboard
    ionic cordova plugin add ionic-plugin-keyboard
    npm install --save @ionic-native/keyboard

  12. edisonmatoso commented on Mar 28, 2018

    @edisonmatoso

    +1

  13. emrade commented on Mar 29, 2018

    @emrade

    Vendettall, i tried that but it didn't work!

  14. ykulynych commented on Mar 30, 2018

    @ykulynych
  15. mhartington commented on Mar 30, 2018

    @mhartington
    Contributor

    If you are still have this issue, please try the newer ionic keyboard plugin

    ionic cordova plugin rm  ionic-keyboard-plugin
    ionic cordova plugin add cordova-plugin-ionic-keyboard
    

    Then set

    <preference name="KeyboardResizeMode" value="ionic" />
    

    In the config.xml

  16. krishnatiwarigithub commented on Apr 4, 2018

    @krishnatiwarigithub

    Hi,
    In the app I am working, everything is working fine. But due to some reason I have to use the inputs within html table. In this case, whenever I am clicking on input it redraws the table, and resets the scroll of table.
    Can anyone help here?

  17. ricardoparro commented on May 28, 2018

    @ricardoparro

    also seeing the transform problem happening. It's quite annoying.
    video-to-gif

  18. Stephane84 commented on Jun 6, 2018

    @Stephane84

    For scrolling pb, i wrote a hack here : #10629 (comment)

  19. AndrWeisR commented on Jun 26, 2018

    @AndrWeisR

    This comment above AbrahamLopez10 commented on Aug 1, 2017 worked perfectly for me, scrolling input fields into view when the Android keyboard pops up.

  20. melwinVincent commented on Sep 27, 2018

    @melwinVincent

    @dylanvdmerwe , @jgw96 @mhartington @Tyler-Darby @manucorporat @adamdbradley

    Hi guys, I just created a custom directive to handle this issue on iOS and android platforms for Ionic 2 & 3 applications. Could you please check if this solve all the problems related to this scrolling issue.

    I used scroll-into-view-if-needed ponyfill to make this directive

    Install ion-input-scroll-into-view directive running the command npm install ion-input-scroll-into-view

    Step-1
    Attach the ion-input-scroll-into-view directive to the ion-input or ion-textarea as follows.

    <ion-input ion-input-scroll-into-view></ion-input>

    <ion-textarea ion-input-scroll-into-view></ion-textarea>

    Step-2

    You have to import the IonInputScrollIntoViewModule in the module.ts of your parent component as follows

    import { NgModule } from '@angular/core';
    import { IonicPageModule } from 'ionic-angular';
    import { ParentPage } from './parent';
    import { IonInputScrollIntoViewModule } from 'ion-input-scroll-into-view';
    
    @NgModule({
      declarations: [
        ParentPage
      ],
      imports: [
        IonicPageModule.forChild(ParentPage),
        IonInputScrollIntoViewModule
      ],
    })
    export class ParentPageModule {}
    

    npm link : https://www.npmjs.com/package/ion-input-scroll-into-view
    github link : https://github.com/melwinVincent/ion-input-scroll-into-view

  21. ionitron-bot commented on Nov 1, 2018

    @ionitron-bot

    Thanks for the issue! We have moved the source code and issues for Ionic 3 into a separate repository. I am moving this issue to the repository for Ionic 3. Please track this issue over there.

    Thank you for using Ionic!

  22. ionitron-bot commented on Nov 1, 2018

    @ionitron-bot

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

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

Metadata

Metadata

Assignees

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