Ionic text-area input event

Viewed 4963

I am using Ionic3, and have:

        <ion-textarea (change)="reviewChange()"></ion-textarea>

When a user changes the input, and blurs focus from the text area, the reviewChange() function is triggered as expected.

Question

Is it possible to add an equivalent of the ion-searchbar's ionInput event? i.e. when a user types text, an event is triggered for each key pressed.

Background

I am trying to track how many characters a user has left. e.g.

500 characters left

In order to do so, I need to track each key stroke. Unless there's a better way, or some automated way to do this?

2 Answers

You may simply try the (input) event. It fires for every key input.

     <ion-textarea [(ngModel)]="text" (input)="reviewChange()"></ion-textarea>
Related