ionic-framework icon indicating copy to clipboard operation
ionic-framework copied to clipboard

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

Open dylanvdmerwe opened this issue 10 years ago • 109 comments

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:

  • [x] 1. When selecting an input the entire form content should be scrolled so that the selected item is visible after the keyboard is displayed.
  • [x] 2. When the keyboard is hidden, set the scrolling back to it's original position and remove added padding.
  • [x] 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.
  • [x] 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]
  • [x] 6. Support for autocorrect, autocomplete & autocapitalize and combinations thereof.

iOS:

  • [x] 1. When selecting an input the entire form content should be scrolled so that the selected item is visible after the keyboard is displayed.
  • [x] 2. When the keyboard is hidden, set the scrolling back to it's original position and remove added padding.
  • [x] 3. Touching an area that is not an input dismisses the keyboard.
  • [x] 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.
  • [x] 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

dylanvdmerwe avatar Apr 19 '16 09:04 dylanvdmerwe

@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?

adamdbradley avatar Apr 19 '16 16:04 adamdbradley

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

dylanvdmerwe avatar Apr 19 '16 17:04 dylanvdmerwe

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

dylanvdmerwe avatar Apr 20 '16 06:04 dylanvdmerwe

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

kevinATglympse avatar May 04 '16 23:05 kevinATglympse

+1 on Android issue #1 :)

layton-glympse avatar May 04 '16 23:05 layton-glympse

Any movement on the items listed in this issue?

dylanvdmerwe avatar Jun 04 '16 21:06 dylanvdmerwe

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

manucorporat avatar Jun 04 '16 21:06 manucorporat

+1 on Android issue #1 :)

eusthace811 avatar Jun 30 '16 21:06 eusthace811

+1 on Android issue :

. When selecting an input the entire form content should be scrolled so that the selected item is visible after the keyboard is displayed.

This is preventing me from fully porting from ionic1 to ionic 2 . All the best!

shangyilim avatar Jul 06 '16 13:07 shangyilim

This is preventing me from fully porting from ionic1 to ionic 2 .

Same here.

kalcheat avatar Jul 12 '16 23:07 kalcheat

+1 on Android issue #1 Please fix this at the earliest! We started a new app on this, but don't want this bug to be a deal breaker and make us go back to ionic 1!

@adamdbradley, @jgw96 Is there some workaround for now?

cyberabis avatar Aug 18 '16 20:08 cyberabis

Can you please give an update? Hard to demo with this primary functionality not working... Thanks!

vogatsiko avatar Aug 18 '16 21:08 vogatsiko

I would appreciate an update on this as well. Our ion-input elements are not scrolled into view when focusing them. We tried switching to normal input elements but that causes all kinds of other issues. Thanks!

alexanderott avatar Aug 23 '16 09:08 alexanderott

Hello all! I can assure you that we are working hard on issues like this. Are you all mainly seeing this issue on ios or android? Or does it happen on both?

jgw96 avatar Aug 23 '16 15:08 jgw96

Happens on android, not sure about ios. Right now, only once I start typing the UI scrolls up to show the input. Ideally, it should happen as soon as focussed and key board pops up.

cyberabis avatar Aug 24 '16 17:08 cyberabis

Hi,

I'm seeing several more issues on iOS on device (haven't checked on Android):

  • With floating labels, when clicking an input it often temporarily displays an empty line before the value, causing the value to jump down and the input to expand vertically. With normal labels, the value is instead sometimes temporarily displaced horizontally.
  • With floating labels, the caret jumps outside the input when scrolling.
  • When using the cordova keyboard plugin and using the accessory bar to navigate between fields, the whole view sometimes jumps. After setting disableScroll(true), the next button works fine but the back button still causes the screen to jump. Not sure if this should be reported there instead?

Thanks for the good work on Ionic, looking forward to having the las kinks ironed out!

anders-hard avatar Sep 14 '16 07:09 anders-hard

Same issue with keyboard and ion-input in Android. Very important issue on all apps with forms!

mifkys avatar Sep 14 '16 08:09 mifkys

No update on this critical issue?

dtalay avatar Oct 05 '16 10:10 dtalay

any update on this issue?

sridharan31 avatar Oct 07 '16 14:10 sridharan31

Would love for this to be looked at in an upcoming RC.

dylanvdmerwe avatar Oct 07 '16 15:10 dylanvdmerwe