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

Alert input autofocus keyboard shows and then goes back to hiding again on item tap. #12560

Closed
karlpatrickespiritu opened this issue Aug 3, 2017 · 5 comments

Comments

@karlpatrickespiritu
Copy link

karlpatrickespiritu commented Aug 3, 2017

1

Ionic version: (check one with "x")
[ ] 1.x (For Ionic 1.x issues, please use https://github.com/ionic-team/ionic-v1)
[x ] 2.x
[ ] 3.x

I'm submitting a ... (check one with "x")
[ x] bug report
[ ] feature request
[ ] support request => Please do not submit support requests here, use one of these channels: https://forum.ionicframework.com/ or http://ionicworldwide.herokuapp.com/

Current behavior:
Alert input autofocus keyboard not working properly on item tap. It shows up like 30% and then it hides again.

Expected behavior:
Alert input autofocus used to work properly before I updated my ionic version.

Related code:

<ion-item
    (tap)="showPromptNumber(player)">
    ......
</ion-item>
showPromptNumber(player: Player) {
    const number = (player.number == 0) ? '': player.number
    this.alertController.create({
      title: 'Edit Panel Number',
      message: `Enter the number for ${player.first_name} ${player.last_name}`,
      inputs: [{
        name: 'number',
        value: `${number}`,
        placeholder: 'Panel Number',
        type: 'tel'
      }],
      buttons: [....]
    }).present();
}

Other information:

Ionic info: (run ionic info from a terminal/cmd prompt and paste output below):

cli packages: (/Users/administrator/development/sportsinfocus-mobile-app/node_modules)

@ionic/cli-plugin-cordova       : 1.6.1
@ionic/cli-plugin-ionic-angular : 1.4.1
@ionic/cli-utils                : 1.7.0
ionic (Ionic CLI)               : 3.7.0

global packages:

Cordova CLI : 7.0.1

local packages:

@ionic/app-scripts : 2.0.2
Cordova Platforms  : ios
Ionic Framework    : ionic-angular 3.5.3

System:

Node  : v6.11.1
OS    : macOS Sierra
Xcode : Xcode 8.2.1 Build version 8C1002
npm   : 3.10.10
@karlpatrickespiritu
Copy link
Author

Only issue I have is the on item tap, the keyboard shows halfway and then goes back to hiding. When tapping the input though, it works properly (the .gif just shows it a bit awkward, but works properly).

@karlpatrickespiritu
Copy link
Author

I remembered adding this preference tag on my config.xml file before.

<preference name="KeyboardDisplayRequiresUserAction" value="false" />

This made the autofocus worked before.

@karlpatrickespiritu
Copy link
Author

well. didn't know there was this option. now working.

this.alertController.create(
...
)
.present({
    keyboardClose: false
});

@badarolp
Copy link

badarolp commented Nov 1, 2017

Nice! This worked for me too.

@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

2 participants