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

currentTarget not available in event object when trigger touch event on a parents child element #653

Closed
ShawnKuan opened this issue Sep 2, 2014 · 2 comments

Comments

@ShawnKuan
Copy link

Hi,
I'm trying to bind a tap/pan event on a parent element with children elements.
When I tap/pan a child element the event object only shows a 'target' but no 'currentTarget'.
I can not find the currentTarget (parent element) in the event object.
Is there a way to get it or is this a bug?

I also created 2 examples about that, the hammer v.1 works fine, but v.2 not.

check these out below, click the green area can not get the parent target if I use v.2:
v.1 http://codepen.io/ShawnKuan/pen/Aeocy
v.2 http://codepen.io/ShawnKuan/pen/paAHK

@anthwinter
Copy link

+1

I have a constant need of getting the element that my hammer instance was created from, not necessarily the child within.

It would be good to have the element returned in the event object alongside the target (which is sometimes a child of the element).

@runspired
Copy link
Contributor

There is a srcEvent you can use, but the events and use and nature of these events does need improved.

Closing in favor of #807

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

3 participants