Using Template Reference variables in Angular 8 with Native Script in Dynamically in ngFor Directive then pass to function

<StackLayout*ngFor="let listItem of list; let i=index;" >

<StackLayout (tap)="onCheckbox(listItem, i, tv)" orientation="horizontal" horizontalAlignment="left">

<Label textWrap="true" verticalAlignment="center" text="Data"></Label>


<FlexboxLayout flexDirection="row" justifyContent="space-between" alignItems="center" >

<TextView #tv "[(ngModel)]="listItem.field" returnKeyType="done" autocorrect="true"></TextView>



Typescript class file function
toggleCheckbox(item, index, textView: TextField) {

this.list = item;

this.inActionPNItemIndex = index;

textView.focus(); // Focused on Check the input field or dismissSoftkeyboard
So you can see how we event focus and close the keyboard access all method od native element



Software Engineer | Bharat Swabhiman Patanjali Social Activist | Speaker | Motivator | Yoga Trainer

Love podcasts or audiobooks? Learn on the go with our new app.

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store