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

Ionic 2 - IOS 10 Keyboard bug #8185

Closed
John0x opened this issue Sep 23, 2016 · 37 comments
Closed

Ionic 2 - IOS 10 Keyboard bug #8185

John0x opened this issue Sep 23, 2016 · 37 comments
Assignees
Milestone

Comments

@John0x
Copy link

John0x commented Sep 23, 2016

Short description of the problem:

This happens on every ios 10 device.
If you open a dialog (alert) und enter something into an input field and you close the dialog (by clicking the close button), then the keyboard will stay open and not close.
I've tried to use the ionic keyboard plugin to close the keyboard manually upon clicking the button (Keyboard.close()), but it has zero affect.

I've created a new blank project (ionic start testProj --v2 --ts) and added a dialog with an input field and a button (actually took the code from the docs to make sure), it has the same effect.

Other information: (e.g. stacktraces, related issues, suggestions how to fix, stackoverflow links, forum links, etc)
There are no error messages or whatsoever.

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

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

Cordova CLI: 6.3.1
Gulp version: CLI version 3.9.1
Gulp local: Local version 3.9.1
Ionic Framework Version: 2.0.0-beta.11
Ionic CLI Version: 2.0.0-beta.37
Ionic App Lib Version: 2.0.0-beta.20
OS:
Node Version: v6.3.0

@John0x
Copy link
Author

John0x commented Sep 23, 2016

It feels like there is something blocking, since the log output and a lot of events are having a weird behavior on ios.

@jgw96 jgw96 removed the alert label Sep 23, 2016
@John0x
Copy link
Author

John0x commented Sep 28, 2016

Any news about this?
Got a release on hold because of this bug.

@jgw96
Copy link
Contributor

jgw96 commented Sep 28, 2016

@John0x would you mind trying this with our wkwebview plugin. Thanks!

@jgw96 jgw96 added the needs: reply the issue needs a response from the user label Sep 28, 2016
@John0x
Copy link
Author

John0x commented Sep 29, 2016

Sadly it does not fix the bug.
Have you tried recreating the bug as described in the first post?

@John0x
Copy link
Author

John0x commented Sep 30, 2016

I installed the plugin properly and it was running (confirmed), but still had the same behaviour.

@zefrench
Copy link

zefrench commented Oct 5, 2016

Same problem here, the keyboard does not close and it's a big problem for iOS apps...

@jkobylec
Copy link

jkobylec commented Oct 5, 2016

This happens in Ionic 2 RC0 as well; fixing this soon would greatly improve the confidence of those of us who are considering Ionic for a new app but want assurance that it will stay on top of device platform updates.

@zefrench
Copy link

zefrench commented Oct 5, 2016

For me it's a pain to update my ionic2 beta 11 app version to RC0..

@jkobylec
Copy link

jkobylec commented Oct 5, 2016

Yes, publishing a workaround that works prior to RC0 would also be super nice since the update isn't trivial.

@zefrench
Copy link

zefrench commented Oct 5, 2016

I start to update today but as I'm not sure if there will be some big change log soon, I think it's better to wait and update my app when Ionic team will ensure there will not be any other BIGGGGG Change....

@John0x
Copy link
Author

John0x commented Oct 6, 2016

It's the RC, so there shouldn't be alot of big changes anymore.
The Keyboard doesn't close automatically but you can close it yourself by subscribing to the onWillDismiss event and then close it manually (Keyboard.close() with the Keyboard plugin).

@zefrench
Copy link

zefrench commented Oct 6, 2016

Thanks @John0x this is a good fix.
Someone here notice there is a strange behavior when you launch an alert ?
The view (only the content not the header) is turning white for some millisecond and then the alert is shown.

@richardshergold
Copy link

I'm seeing this problem too - the keyboard is not disappearing after an alert. IOS 10 (iPhone SE) running from within Ionic View.

@sjdrew
Copy link

sjdrew commented Oct 8, 2016

Definitely a bug. I was also able to get rid of the keyboard by using onDidDismiss() and Keyboard.close() on the alert controller, but still looks unprofessional as the screen scrolls up including the header. Hope it gets fixed soon.

@manucorporat manucorporat self-assigned this Oct 8, 2016
@GrischaSchmiedl
Copy link

Is there an update to this bug? With RC.1 and iOS10 I still see the bug.

@jgw96 jgw96 removed the needs: reply the issue needs a response from the user label Oct 26, 2016
@jgw96 jgw96 added this to the 2.0.0-rc.2 milestone Oct 26, 2016
@ghenry22
Copy link

Yep I also see this one with rc1.

@jvlobo
Copy link

jvlobo commented Nov 2, 2016

It also happens to me on RC1, and not in an alert. Just on a regular input on a regular form, if you send the form by tapping on return key, after the redirect with this.nav.setRoot the keyboard keeps open.

@brandyscarney brandyscarney modified the milestones: 2.0.0-rc.3, 2.0.0-rc.2 Nov 4, 2016
@manucorporat
Copy link
Contributor

Working in this issue! Sorry for taking so long

@rodrigobnn
Copy link

I made a workaround importing Keyboard from 'ionic-native' anda executing 'Keyboard.close()' after the action I needed

@ahlidap
Copy link

ahlidap commented Nov 11, 2016

Hi,

Importing the Keyboard and force it to close partially worked for me, as the input dialog sometimes stays open and freezes the app.

will this be fixed in the next version? Any hind on a release date for it?

Thanks for your effort.
Cheers

@DianeBustamante
Copy link

I am also experiencing this issue with an Ionic 1 project. The keyboard was working fine until I updated my iPhone to iOS 10.1.1.

Will the fix be applied to both Ionic 1 and 2?

Thanks

@brandyscarney brandyscarney modified the milestones: 2.0.0-rc.3, 2.0.0-rc.4 Nov 17, 2016
@numerized
Copy link

Same here on Ionic2rc3 I'm using Ionic-native and Keyboard.close() meanwhile.

@adamdbradley
Copy link
Contributor

Thanks for the report everyone, we're working on this right now and I'll keep everyone updated, thanks

@adamdbradley
Copy link
Contributor

I've made some updates to how alerts work when there's a text input, and it's on a mobile device. Would this group be able to test out our nightly version and let me know how it goes? Thanks

@ohh2ahh
Copy link

ohh2ahh commented Nov 22, 2016

The keyboard is working great on iOS 10.1.1. Although the alert isn't vertically centered anymore and it doesn't get "pushed up" by the appearing keyboard. Is that intended?

bildschirmfoto

@wwallace
Copy link

wwallace commented Dec 2, 2016

@ohh2ahh It seems that it is intended to solve the keyboard overlap issue, per the commit:
// this alert has a text input and it's on a mobile device so we should align
// the alert up high because we need to leave space for the virtual keboard
// this also helps prevent the layout getting all messed up from
// the browser trying to scroll the input into a safe area

@Daphko
Copy link

Daphko commented Dec 2, 2016

How can i implemented the changes from @adamdbradley ? I still have the alert input keyboard issue and no idea how to solve this or make a workaround.

@numerized
Copy link

numerized commented Dec 3, 2016

@Daphko you can install ionic native keyboard plugin and use it like this


import { Keyboard } from 'ionic-native';

[...]


createTodo(){
    var id = new Date();
    let prompt = this.alertCtrl.create({
      title: this.translate.instant("todo.addTodo"),
      message: this.translate.instant("todo.addTodoMessage"),
      inputs: [
        {
          name: 'title'
        }
      ],
      buttons: [
        {
          text: this.translate.instant("ui.cancel"),
          handler: () => Keyboard.close()
        },
        {
          text: this.translate.instant("ui.save"),
          handler: data => {
            this.todoService.createTodo({
              _id:'todo:'+id.getTime(),
              title: data.title,
              type:'todo',
              created_at : new Date().toISOString()
            });
          }
        }
      ]
    });
 
    prompt.present();
 
  }

@Daphko
Copy link

Daphko commented Dec 4, 2016

Thx @numerized but the solution has one problem. If you click outside the alert box, the alert box closes and the keyboard stays open. Thats because there is no handler for this click action. Do you have any solution for this?

@dominikstrasser
Copy link
Contributor

I think onDidDismiss and onWillDismiss are called.

prompt.onDidDismiss(()=> {
   Keyboard.close()
})

@arturalkaim
Copy link

Hi!
I'm having this issue with the ion-searchbar.
The keyboard just don't go away.

No answer for this.keyboard.close(); and console.log("keyboard open:", this.keyboard.isOpen()); always prints true.

Any info that could fix this?

Your system information:
Cordova CLI: 6.4.0 
Ionic Framework Version: 2.0.0-rc.6
Ionic CLI Version: 2.2.1
Ionic App Lib Version: 2.2.0
Ionic App Scripts Version: 1.0.1
ios-deploy version: 1.9.0 
ios-sim version: Not installed
OS: macOS Sierra
Node Version: v6.9.1
Xcode version: Xcode 8.2.1 Build version 8C1002

@peterpeterparker
Copy link
Contributor

peterpeterparker commented Feb 9, 2017

@arturalkaim try Keyboard.close(); instead of this.keyboard.close();

import {Keyboard} from 'ionic-native';
...
    Keyboard.close();

@arturalkaim
Copy link

Thanks @peterpeterparker!
It should close on blur but this worked as a workaround...

@jayaj12
Copy link

jayaj12 commented Feb 14, 2017

I have issues with ionic 1.3.2 and iOS 10.1.1. When keyboard pop up the page scroll up with lot of space in between the keyboard and input field. This was working fine in iOS 9.1.1.

@ghost
Copy link

ghost commented Jul 31, 2017

When I use Keyboard.close(); the keyboard closes but whenever I touch the screen it reopens. Any ideas anyone?

@mino922
Copy link

mino922 commented Oct 7, 2017

@RobVR I am also having this issue. Did you ever find a fix? I am using iOS 11.

@ionitron-bot
Copy link

ionitron-bot bot commented Sep 1, 2018

Thanks for the issue! This issue is being locked to prevent comments that are not relevant to the original issue. If this is still an issue with the latest version of Ionic, please create a new issue and ensure the template is fully filled out.

@ionitron-bot ionitron-bot bot locked and limited conversation to collaborators Sep 1, 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