User must tap twice
Code sample:
<ion-input type="text" (tap)="handle_click($event)"></ion-input>
the handle_flick() function is only triggered after the second tap. On the first, the input get focus and keyboard is opened, but the function is not called. User has to tap again. It seems that the first tap event triggers the some keyboard event to open it and then prevents the default behaviour.
Tested only on Android. Through browser (ionic serve) this does not happens.
Cordova CLI: 6.1.0 (cordova-lib@undefined)
Gulp version: CLI version 3.9.1
Gulp local: Local version 3.9.1
Ionic Version: 2.0.0-beta.4
Ionic CLI Version: 2.0.0-beta.23
Ionic App Lib Version: 2.0.0-beta.13
OS: Distributor ID: LinuxMint Description: Linux Mint 17.3 Rosa
Node Version: v5.7.0
Can you use the (focus) event instead? The problem with hammer's tap event on inputs is that browsers are very inconsistent on how they handling click/touch events.
@adamdbradley it worked, but now I have another problem: I'm using this to trigger the DatePicker.
When input got focus, the DatePicker is opened (inside the handle_click function()) and then the focus() event is triggered again, opening another instance of the DatePicker.
I'm gonna check if I can handle this...
Thanks for the help!
Hello all! As it seems it has been a while since there was any activity on this issue i will be closing it for now. Feel free to comment if you are still running into this issue. Thanks for using Ionic!
Still facing the same issue with opening a modal when user focuses on the input. Another instance of the modal is opened.
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.
Most helpful comment
Can you use the
(focus)event instead? The problem with hammer's tap event on inputs is that browsers are very inconsistent on how they handling click/touch events.