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

Keyboard overlaps the text input when the input is placed inside an <ion-footer>

Open chrskrchr opened this issue 10 years ago • 56 comments

Short description of the problem:

When an <ion-input type="text"> is placed inside an <ion-toolbar> in an <ion-footer>, the iOS keyboard overlaps text inputs placed in an <ion-footer> and the entire page "jumps" when the input receives focus.

keyboard

What behavior are you expecting?

I would expect the text input to be shown above the keyboard so the user can see what they're typing, similar to what happens in the Messages app on iOS. I also wouldn't expect the entire page to jump down immediately after the input receives focus.

Steps to reproduce:

  1. Create a new project with the blank template
  2. Add the following to home.html, run the app on iOS, and focus on the text input
<ion-footer>
    <ion-toolbar>
        <ion-input type="text" placeholder="Add a message..."></ion-input>
    </ion-toolbar>
</ion-footer>

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

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

Cordova CLI: 6.2.0 Gulp version: CLI version 3.9.1 Gulp local: Local version 3.9.1 Ionic Framework Version: 2.0.0-beta.10 Ionic CLI Version: 2.0.0-beta.31 Ionic App Lib Version: 2.0.0-beta.17 ios-deploy version: 1.8.6 ios-sim version: 5.0.8 OS: Mac OS X El Capitan Node Version: v4.2.3 Xcode version: Xcode 7.3.1 Build version 7D1014

chrskrchr avatar Jun 30 '16 21:06 chrskrchr

I just joined the party and I can't believe how long everyone has been waiting on this. This seems like such an essential thing to get right. How have people been dealing with this in the meantime?

capcom-r avatar Jan 03 '18 08:01 capcom-r

@borys You saved my day!!!! Good job, works well. Thanks :+1: https://github.com/ionic-team/ionic/issues/7149#issuecomment-246965922

renjithspace avatar Jan 08 '18 07:01 renjithspace

I have a related issue with the keyboard, first I had the problem with the overlaps on footer and after installing the plugging XKWebView the footer doesn't be hidden anymore, but when keyboard is open an space is added above it (between keyboard and footer)

Here is the image: img_0524b168f6a6-1

Have someone this issue? How can I fix it? I'm new on development with Ionic. Help!

dulcelariz avatar Jan 09 '18 21:01 dulcelariz

@dulcelariz You can fix that by disabling the keyboard scroll.

  1. Install ionic native keyboard plugin
$ ionic cordova plugin add ionic-plugin-keyboard
$ npm install --save @ionic-native/keyboard
  1. Then disable keyboard scroll in your component constructor or in ionViewDidLoad observer
this.keyboard.disableScroll(true);

Please note: make sure to run it after platform ready. You can use this.platform.ready() promise to do that

  1. Disable scroll assist in ionicModule
IonicModule.forRoot(MyApp, { scrollAssist: false }),

And make sure the footer you added in ion-footer.

That's it.

renjithspace avatar Jan 10 '18 05:01 renjithspace

@renjithvk thanks for your help, I did what you said and the issue still there. 😢

dulcelariz avatar Jan 10 '18 20:01 dulcelariz

@dulcelariz I had that kind of issue. I fixed it by did that. Please try:

Disable scroll assist in ionicModule (app.module.ts)

IonicModule.forRoot(MyApp, { scrollAssist: false }),

Please check the comment https://github.com/ionic-team/ionic/issues/7149#issuecomment-356505112 I've updated it with some more points. Hope it will help you 👍

renjithspace avatar Jan 11 '18 05:01 renjithspace

@renjithvk I tried what you did and the issue continue happening

This is my ionic info: Will it be related to this? screen shot 2018-01-11 at 3 41 56 pm

dulcelariz avatar Jan 11 '18 21:01 dulcelariz

@dulcelariz I'm sorry to hear that. I'd solved by did that.

This is my ionic info. screen shot 2018-01-12 at 10 21 34 am

renjithspace avatar Jan 12 '18 04:01 renjithspace

Still working with ionic 3 with @borys solution (https://github.com/ionic-team/ionic/issues/7149#issuecomment-246965922)

Ionic Info

cli packages: (/usr/local/lib/node_modules)

    @ionic/cli-utils  : 1.19.2
    ionic (Ionic CLI) : 3.20.0

global packages:

    cordova (Cordova CLI) : 7.1.0 

local packages:

    @ionic/app-scripts : 3.1.8
    Cordova Platforms  : android 6.4.0 ios 4.5.4
    Ionic Framework    : ionic-angular 3.9.2

System:

    ios-deploy : 1.9.2 
    Node       : v8.9.3
    npm        : 5.7.1 
    OS         : macOS High Sierra
    Xcode      : Xcode 9.2 Build version 9C40b 

Environment Variables:

    ANDROID_HOME : Users/gobae/Library/android/sdk

Misc:

    backend : pro

MiguelHernandezCh avatar Mar 25 '18 04:03 MiguelHernandezCh

The proposed solution only applies to ios it seems but what about android? I am using the ionic cordova keyboard plugin and this isnt working.

Ross-Rawlins avatar Jun 01 '18 10:06 Ross-Rawlins

@borys solution worked for me.But the transition is not so smooth in my case.Any way i can achieve that?

Hemanth-wtt avatar Jun 29 '18 07:06 Hemanth-wtt

Just by installing this plugin https://github.com/ionic-team/cordova-plugin-ionic-keyboard fixed the issue for me

BorntraegerMarc avatar Jul 24 '18 09:07 BorntraegerMarc

Add https://ionicframework.com/docs/native/keyboard/ plugin to ionic application and add this imports in your module.ts file

IonicModule.forRoot (MyApp, {
scrollPadding: false,
scrollAssist: true,
autoFocusAssist: true
})

caribeedu avatar Sep 26 '18 15:09 caribeedu

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!

ionitron-bot[bot] avatar Nov 01 '18 20:11 ionitron-bot[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!

ionitron-bot[bot] avatar Nov 28 '18 21:11 ionitron-bot[bot]

Issue moved to: https://github.com/ionic-team/ionic-v3/issues/117

ionitron-bot[bot] avatar Nov 28 '18 21:11 ionitron-bot[bot]