Soft Keyboard close by android back button event handler

event
nativescriptcore

#1

Hello, I m using on blur function for my some of calculation on listview of app.but some of users are closing their keyboard directly by back button of mobile.because of that onblur function is not getting called and my calculations are not getting performed.
Is there any event so that i can handle closing of keyboard by mobile back button.?


#2

You may use text change event with debounce if required.


#3

text change event are not getting called from xml file.i tried a lot. and also calling textchange event form js is not working for me,because for that we have to-define it onLoaded and i ma loading list on my page after selcting one dropdown. ( i tried this from js textField11 = args.object.page.getViewById(“meter_closing”); textField11.on(“textChange”, onmeter_closing);
Because of that it is important for me to handle keyboard close event


#4

Yes, you can’t bind property change events in XML, that’s a limitation with NativeScript Core.

But if you have multiple textfields, you don’t have to add listeners to each invidually, simply extend your own textfield, add listeners and make calculations.

FYI, there is no direct API from Android to listen for soft keyboard visibility.


#5

Ok. Thank you so much.I will try by adding listneners to textfields,