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

bind()ing an event handler makes me lose access to the matched element #26

Open
ricardobeat opened this issue Apr 1, 2013 · 1 comment
Labels

Comments

@ricardobeat
Copy link
Member

Let's say you have

one.on('click .two', function (e, el) {
    // e.target = can be a descendant
    // el == the delegate root
    // this == xxx
}.bind(xxx))

There is no way you can access the actual element (.two). jQuery exposes it as e.currentTarget (I think), along with e.delegateTarget. Should we manipulate the event object too, maybe also normalize e.keyCode/which while we're at it?

@jcemer
Copy link
Member

jcemer commented Apr 1, 2013

Yes, it is across currentTarget.

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