Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Press event is not fired on Ionic 5

I want to implement multiple select on multiple items (a list of ion-item-sliding) when one of them is pressed for few seconds by adding (press) to each ion-item-sliding and it seems that the press event is never fired. I moved the press event to ion-item but nothing still happened. Then I tried to test directly the press event on a ion-button and found out that the press event is the problem because when I change it to click it's working perfectly. Here is what I tried:

<ion-button (press)="itemPressed()">Test</ion-button>
itemPressed() {
    console.log("expecting to work");
}
like image 636
Michaël Randria Avatar asked Oct 27 '25 08:10

Michaël Randria


1 Answers

In addition to @Arj 1411's answer add HammerModule in '@angular/platform-browser' imports and this should be work.

like image 67
Bary Avatar answered Oct 29 '25 23:10

Bary



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!