Ionic v3 Alert close freezes view

时间:2019-03-06 11:38:16

标签: ionic-framework ionic3

I've got a login page where I can open an alert prompt via a button click to enable auto-login feature.

When the alert comes up, also the keyboard comes up and moves the view and the alert prompt up to focus on the input field of the alert. This works as expected.

But when I close the Alert Prompt via Cancel or OK Button, the login page doesn't respond any more. I have to reload the page to be able to use it.

I figured out, that the Alert close doesnt work properly and the Page doesnt get reloaded and stay in an old state (moved up to to the keyboard).

Any Ideas how to focus back on the page or to properly close the alert?

showAlertPrompt() {
    let alert = this.alertCtrl.create({
      title: 'Login',
      inputs: [
        {
          name: 'username',
          placeholder: 'Username'
        },
        {
          name: 'password',
          placeholder: 'Password',
          type: 'password'
        }
      ],
      buttons: [
        {
          text: 'Cancel',
          role: 'cancel',
          handler: () => {}
        },
        {
          text: 'OK',
          handler: () => {}
        }
      ]
    });
    alert.present();
  }

0 个答案:

没有答案