简体   繁体   中英

Click Event of <ion-col> not working in iOS for IONIC 3 Application

I am working with ionic 3 application. My homepage contains a grid of icons and I created a click event for <ion-col> that contain icons.

HTML

<ion-col col-4 text-wrap (click)="changeSubCategory(17)">
    <ion-icon ios="ios-boat" md="md-boat" class="iconstyle primary-font-color"></ion-icon>
    <br>
    <p class="pstyle">Travel</p>
</ion-col>

This event works very well on an Android device but somehow it's not working on iOS device. I am also not getting any error in console.

Just add the 'tappable' directive to your element. Like:

 <ion-col text-center tappable (click)="presentSortedFoodModal('sugar')">
....
</ion-col>

I solved this issue. My ion-grid was inside ion-list . i remove ion-list and place ion-gird outside <ion-list> and click event start working on the iOS device too.

I am not sure this is correct approach or not but it solved my problem.

better answers still welcome.

thanks

我确实面临同样的问题,删除ion-list解决了我的问题。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM