Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
Allow for dom handlers only of HammerJS events #19604
I'm submitting a Feature Request
When listening to the HammerJS events (e.g. 'tap') the listener is automatically added to the HammerManager instance. This leads to the issue if you want to listen to the same HammerJS event on nested element as there is no possibility to control propagation of the events and HammerManager of the parent elements can handle the event before the nested elements (In my case I need to use Renderer2.listen method). The HammerJS support the option "domEvents", but that has no effect as the event registration is always routed to the HammerGesturePlugin:
Enable an option on HammerGestureConfig that will use domEvents of HammerJs and will register callback at dom element to enable bubling and propagation control of touch events.
A workaround to achieve that behavior is possible but not obvious with custom HammerGestureConfig:
It would be preferable if the event is registered to the do element directly in HammerGesturePlugin if the HammerGestureConfig specifies domEvents options.
Minimal reproduction of the problem with instructions
register 'tap' listener in parent and child elements using Renderer2.listen method
What is the motivation / use case for changing the behavior?
There is possible woraround as mentioned above, but the current behavior is unexpected if you are assuming that touch events are handled in similar way as dom events.