NativeScript: How can I catch tap event in case if user taps on empty space in RadListView?

427 views Asked by At

enter image description here

If I tap on radlistview items - it catches events, but if I tap on empty space at the bottom of radlistview - then silence.

Thanks for any help!

1

There are 1 answers

2
Narendra On

You need to set (tap) and (itemTap) for RadListView.

<RadListView [items]="countries" (itemTap)="onItemTap($event)" (tap)="tapOutSide($event)">

and in your .ts file

public onItemTap(args) {
        console.log("Item Tapped at cell index: " + args.index);
    }

    public tapOutSide($event) {
        console.log("TAPPED EMPTY SPACE");
        console.log($event.object);
    }

P.S. From the Screenshot, it looks like an Android phone and above solution works fine on Android. For ios, there is an open issue with nativescript.