TextField returnPress event not working on Android #1721
Copy link
Copy link
Closed
Description
Just to make sure I am not doing anything wrong in my project, I have taken {N} sample Tap Achievement app and added a text field. I am trying to use returnPress event with the TextField and I cannot make it work.
<TextField text="This is a test" returnKeyType="next" returnPress="{{ search }}" autocorrect="false"/>
If I attache the same function to a tap event of a button, it works:
<Button text="TAP" tap="{{ search }}" />
HelloWorldModel.prototype.search = function(){
console.log("In search");
}
I am on NativeScript 1.6 and I don't have a Mac to test this for iOS.
Reactions are currently unavailable
Activity
Daxito commentedon Mar 17, 2016
ok, fyi, you fixed the binding issue but now you broke the other way:
returnPress="{{ onDone }}" <--- Now works in 1.7.0, thank you
returnPress="onDone" <--- Does not work anymore :-(, it was ok in 1.6.2
enchev commentedon Mar 18, 2016
Hey @Daxito,
I've just tested this and everything seems to work as expected:
Daxito commentedon Mar 18, 2016
@enchev
Please take a look the attached sample app, it does not even work with binding.
I added two text fields, one with a reference to a function in the code behind and the other one bound to the view model, after tapping the "Done" keyboard key nothing is displayed in the console, maybe I am missing something here?
Using {N} 1.7.0 and using a real android device.
Also, I did a test using {N} 1.6.2 (by uninstalling 1.7.0), and guess what, it worked for both scenarios! Let me know if you need more information.
SampleApp.zip
lock commentedon Aug 29, 2019
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.