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

asyncCommand not usable on input fields #1

Closed
andersarpi opened this issue Aug 15, 2012 · 1 comment
Closed

asyncCommand not usable on input fields #1

andersarpi opened this issue Aug 15, 2012 · 1 comment
Assignees
Labels

Comments

@andersarpi
Copy link

This currently fires the command (saveTask) when I click on the input box.

<input type="text" data-bind="value: inputText, command: saveTask" />

It would be nice if it was possible to:

  • Make it not fire when I click an input box
  • Make it fire when I press enter while having an input box focused
@johnpapa
Copy link
Member

Thanks for the feedback. The good news is that this should already work for you. Click is the default, but you can also override that and pas your own event binding like this:

<input type="text" 
    data-bind="value: inputText, command: {keypress: saveTask}" />

Obviously we need to add that to our documentation and examples :-)

@ghost ghost assigned johnpapa Aug 15, 2012
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants