mercredi 24 février 2016

In Ember 2, I am unable to get the event object when binding on=keypress event to {{input}}

In Ember 2, I am trying to do probably the most simple thing. When I bind an event to an input element, I expect the event argument to be passed to my action handler but I am unable to get that. Simply I require to check for keyCode 13 which is for "enter" key on keyboard.

 {{input type=text
           value=model.filters.query
           placeholder="Search by title"
           action="search" onEvent="key-press"
 }}

My Function Handler is:

search(newValue){
 // I am only getting newValue and not the event object
}




Aucun commentaire:

Enregistrer un commentaire