Keyboard reopens after close repeatedly on iOS

The issue was not all iOS input fields but turned out to be specifically the Javascript Stripe implementation that we had.

It injects an iframe into the page and this was causing the issue.

I ended up taking the approach suggested at https://forum.ionicframework.com/t/ios-iframe-input-issue/106486/2 and implemented it as follows:

declare var cordova;
@ViewChild('ioshack') ioshack;
  ionViewWillLeave(){
    if(cordova.plugins.Keyboard.isVisible){
      this.ioshack.setFocus();
    }
  }
<ion-input #ioshack type="text" value="" class="ioshack" style="height: 0px;"></ion-input>

Its a hack but it works.

3 Likes