Open runspired opened 9 years ago
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!
@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.
Thanks, keep up the good work.
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)?
Is there any progress/work done to integration propagation into Hammer.JS. If not i'd like to help out.
@dcbartlett there has not been yet we are happy to have a PR though!
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.
@josdejong thank you very much,I resolve this problem by your plugin 👍
I created a small codepen for this bug https://codepen.io/kenhub/pen/yWgLmj
what is the configuration from this plugin with angular 6/7 in main.ts
@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.
@VilOstreiko I don't know.
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
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:
https://github.com/hammerjs/hammer.js/issues/735 https://github.com/hammerjs/hammer.js/issues/727 (issues with tap/click similarities) https://github.com/hammerjs/hammer.js/issues/690 https://github.com/hammerjs/hammer.js/issues/652