Get text property TextField after keyboard in nativescript

I have a TextField and want to listen for an event when the user has finished typing and wants to continue. I don't want to call the function every time the user presses any key, and I don't want to add a submit button. The keyboard offers a "done" button, so why not use that. The only question that follows below is listening for this particular event.

+3


source to share


2 answers


returnPress

should do what you want:



<TextField (returnPress)="returnPress()" 

      

+2


source


With NativeScript 3, you can use a new event blur

. This way, you will not only call the function when the Enter key is pressed, but also when the user leaves the field in other ways (for example, tap another field).

See the API link here https://docs.nativescript.org/api-reference/classes/_ui_text_base_.textfield.html#blurevent



Example:

<TextField (blur)="userLeftTheField()"> 

      

0


source







All Articles