Closed dpdragnev closed 8 years ago
You should be able to register to the change event and compare text.length === mask.length and call dismissSoftInput when true.
I don't have time to create a working example, but when I get a chance I'll see about making one.
Thanks for your quick reply. I will try your suggestion and will report back.
How would you suggest to capture the change event? I tried propertyChange="{{ verifyMaskInput }}", but this event never triggered while I was typing.
I believe it should be propertyChange="text"
See https://docs.nativescript.org/core-concepts/events#propertychange-event for more info.
Perfect. Thank you for your help.
The event has to be declared as propertyChange="eventHandler" and in it I did:
var obj = args.object; if (obj.text.length == obj.mask.length) { obj.dismissSoftInput(); }
This achieved the desired input.
Hello,
I would like to close the keyboard once the user have entered the last character in the field. Is there a way to accomplish that?
Thank you.