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

Recognizers for overlapping Hammer instances will both fire. #807

Open
runspired opened this issue Jun 11, 2015 · 13 comments
Open

Recognizers for overlapping Hammer instances will both fire. #807

runspired opened this issue Jun 11, 2015 · 13 comments

Comments

@runspired
Copy link
Contributor

There should be a better eventing / delegation / bubbling pattern to prevent the issues this creates.

This is a meta issue, the following other issues are affected by it in some way:

#735
#727 (issues with tap/click similarities)
#690
#652

@josdejong
Copy link

Thanks for picking this up! It would be really great if hammer.js would support event propagation.

Out of necessity I've built an extension on top of hammer.js offering event-propagation: https://github.com/josdejong/propagating-hammerjs. I hope this solution can retire soon!

@arschmitz
Copy link
Contributor

@josdejong Thank you! We have already been having talks around this and the best way to handle it. Right now the talks have focused on moving closer to native events.

@josdejong
Copy link

Thanks, keep up the good work.

@robstown
Copy link

Thanks all who contributed, this is an awesome library. @josdejong, your propagating extension helps, but I guess I first interpreted the readme wrong as I though firstTarget was referring to what is normally currentTarget, but I see it is instead the top element that the original event started on. Is there still movement to incorporate propagation into hammer.js as well as closing #653 (linked to this issue)?

@dcbartlett
Copy link

Is there any progress/work done to integration propagation into Hammer.JS. If not i'd like to help out.

@arschmitz
Copy link
Contributor

@dcbartlett there has not been yet we are happy to have a PR though!

@Smona
Copy link

Smona commented May 18, 2017

I ran into this issue as well, and am having success using @josdejong 's propagating-hammerjs. This functionality is totally vital for more complex UIs, and would be nice to have included in hammerjs by default.

If nobody has time to work on this issue, it seems a quick fix could be to just add propagating-hammerjs as a dependency and wrap every Hammer instance with it, or provide a configuration option for enabling it.

@parox2014
Copy link

@josdejong thank you very much,I resolve this problem by your plugin 👍

@joker-777
Copy link

I created a small codepen for this bug https://codepen.io/kenhub/pen/yWgLmj

@ivanmiiranda
Copy link

what is the configuration from this plugin with angular 6/7 in main.ts

@VilOstreiko
Copy link

@josdejong
is there any possible way to include your plugin to angular application? I use hammerjs just importing it as a module and providing with HAMMER_GESTURE_CONFIG injection token.

@josdejong
Copy link

@VilOstreiko I don't know.

@deerawan
Copy link

Interestingly, there's a unit test to check this propagation behavior and the test is passed. 🤔

https://github.com/hammerjs/hammer.js/blob/master/tests/unit/test_propagation_bubble.js#L44

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests