Click event on an icon inside ion-input doesn't work on Android


#1

I have the following code. It works fine in browser, but doesn’t work on Android emulator or device. The click event doesn’t get triggered there. I am using Ionic 2 RC3. Does anybody know if it is a bug or by design? How can I work around it? Thanks.

<ion-item>
    <ion-label fixed>Name</ion-label>
    <ion-input type="text" [(ngModel)]="ingredient.name"></ion-input>
    <ion-icon name="add" (click)="addIngredient()" item-right color="primary"></ion-icon>
  </ion-item>

#2

If it’s clickable it should probably be an icon button rather than just an icon.


#3

Thank you! I changed the code to the following. Now it worked!

<ion-item>
    <ion-label fixed>Name</ion-label>
    <ion-input type="text" [(ngModel)]="ingredient.name"></ion-input>
    <button ion-button icon-only clear item-right (click)="addIngredient()"><ion-icon name="add"></ion-icon></button>
  </ion-item>