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

submit events have a different behaviour when delegated #5

Closed
schinckel opened this issue Feb 24, 2014 · 1 comment
Closed

submit events have a different behaviour when delegated #5

schinckel opened this issue Feb 24, 2014 · 1 comment

Comments

@schinckel
Copy link
Contributor

When you bind to a knockout submit handler, you get the 'form' element as the only argument.

When you use delegatedEvents, and data-submit='handler', you get (data, event), as you would see with a click (or other) handler.

Should this be brought into line with how knockout's submit binding handler works, or not?

schinckel added a commit to schinckel/knockout-delegatedEvents that referenced this issue Feb 24, 2014
References rniemeyer#5 (rniemeyer#5).

Knockout's submit binding handler is subtly different to the other event handlers.

Instead of the root element being `this`, and getting two arguments `data`, and `event`, it sets `this` to the current bindingContext value, and passes a single argument that is the form element that is bound.

This patch replicates that behaviour.
@rniemeyer
Copy link
Owner

makes sense. added a spec and merged. Thanks!

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

2 participants