Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TextField returnPress event not working on Android #1721

Closed
rajagottumukkala opened this issue Mar 8, 2016 · 4 comments · Fixed by #1726
Closed

TextField returnPress event not working on Android #1721

rajagottumukkala opened this issue Mar 8, 2016 · 4 comments · Fixed by #1726
Assignees
Milestone

Comments

@rajagottumukkala
Copy link

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.

@Daxito
Copy link

Daxito commented 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
Copy link
Contributor

enchev commented Mar 18, 2016

Hey @Daxito,

I've just tested this and everything seems to work as expected:

<Page>
  <StackLayout>
    <TextField returnPress="press" />
  </StackLayout>
</Page>
exports.press = function(args) {
    console.log("HERE")
}

@Daxito
Copy link

Daxito commented 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
Copy link

lock bot commented 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.

@lock lock bot locked and limited conversation to collaborators Aug 29, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants