Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to prevent click on parent in Angular/Ionic2?

I have the list on which items when it's clicked I need to do some actions. Also I have sliding menu on those actions. When I slide it and click it also triggers the click on `ion-item-sliding. Is it possible somehow to prevent click when slid is open?

<ion-item-sliding *ngFor="let event of events" (click)="showModalInfo(event)">
    <ion-item>
        <h2>{{ event['Event type'] }}</h2>
    </ion-item>
    <ion-item-options side="right">
        <button ion-button color="light" icon-left (click)="showDescription(event)">
            <ion-icon name="ios-more"></ion-icon>
            More
        </button>
    </ion-item-options>
</ion-item-sliding>
like image 296
Kin Avatar asked Oct 15 '25 14:10

Kin


1 Answers

(click)="$event.stopPropagation();showDescription($event)"
like image 130
Günter Zöchbauer Avatar answered Oct 18 '25 08:10

Günter Zöchbauer



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!