import { Component , HostListener , ViewChild } from '@angular/core' ; import { IonList } from '@ionic/angular' ; import { elementHasAncestor } from '../../../helpers/element-has-ancestor' ; @ Component ( { selector : 'kirby-list-experimental' , templateUrl : './list-experimental.component.html' , } ) export class ListExperimentalComponent { @ ViewChild ( IonList , { static : true } ) list : IonList ; @ HostListener ( 'click' , [ '$event' ] ) closeAllSlidingItems ( e ) { if ( elementHasAncestor ( e . target as HTMLElement , 'ion-item-option' , 'ion-list' ) ) { this . list . closeSlidingItems ( ) ; } } }