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

Input helper with input action throws error #13058

Closed
danevans opened this issue Mar 6, 2016 · 7 comments
Closed

Input helper with input action throws error #13058

danevans opened this issue Mar 6, 2016 · 7 comments

Comments

@danevans
Copy link

danevans commented Mar 6, 2016

Using something like:

{{input type="text" value=newName input="updateName"}}

Causes an exception (Uncaught TypeError: method.apply is not a function) to be thrown.

It's using this form with the event name as input which is listed in valid event names.

It appears that in the trigger method within Ember's CoreView, this[name] is getting resolved to the string "updateName" instead of the method with that name.

Working example here: https://ember-twiddle.com/4bd4b572617660d467dd

@GCorbel
Copy link

GCorbel commented Mar 15, 2016

I checked events available on inputs on Chrome and input is not listed. I'm not able to find a documentation on this event. Do you have something?

Here is the list of events available on Chrome :
capture du 2016-03-15 17 12 01

@GCorbel
Copy link

GCorbel commented Mar 15, 2016

Oups, sorry. input is in the list.

@pixelhandler
Copy link
Contributor

I'm curious if this is related, #11678

@cibernox
Copy link
Contributor

@danevans If your are in 2.3.1+ i'd strongly recommend to use this instead:

<input type="text" value={{newName}} oninput={{action "updateName"}}>

@danevans
Copy link
Author

@cibernox is the recommendation to not use the {{input}} helper at all or just avoid it when using actions or just certain actions like this one?

@cibernox
Copy link
Contributor

@danevans I don't use it anymore. {{input}} is harder to use an around 40x slower

@locks
Copy link
Contributor

locks commented Apr 26, 2016

I am closing this issue because my understanding is a resolution has been reached.
Feel free to re-open the issue if you think it's still justified, thank you!

@locks locks closed this as completed Apr 26, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants