Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Ionic 2: ion-content doesnt scroll up on keyboard

I am creating an Ionic 2 mobile app and am having some problems with input fields and keyboards. For now, I am only referring to iOS. This is the page without any input activated.

enter image description here

Now, If I tap on CVV or Postal Code input fields, the keyboard does not push the ion-content up so the cvv or postal code fields are in focus above the keyboard.

enter image description here

If I tap on postal code field, the entire input is covered by the keyboard. No scrolling happens. Before this issue, when the keyboard would open the content would squeeze up above the keyboard, but the content would squeeze, not push up off the screen if it is too large to fit the content.

Anyone have advice on how to do this? I do not think it requires any plugins to control the content or keyboards. It seems to have something to do with styling with percentages.

like image 336
Pezetter Avatar asked Oct 29 '22 13:10

Pezetter


1 Answers

I need to see some page code to help, but i had this problem too and solved by doing:

  • Wraped all my inputs on <ion-item> tags.
  • Used ionic input tags (not the regular <input> tag).
  • Put all inside a <form> or <ion-list> (what you probably have done).

Without this i was having issues of fields remaining static where they are and focus errors on many input types (textarea being the one with more errors).

like image 171
Gabriel Barreto Avatar answered Nov 09 '22 13:11

Gabriel Barreto