Search code examples
angularangular-materialhammer.js

Angular Material tooltip bug workaround with HammerJS


I recently discovered a few bugs relating to touch scrolling issues from mat-tooltips in my application. This behavior is outlined here: GitHub Issue. There is a workaround solution posted in the issue page that seems to have worked in the past. This is no longer is the case. The post has instructions for overriding the HammerJS configuration class. Here is the link to that post from 2017: Tutorial.

Following this tutorial now causes an issue:

mc.get("swipe").set({ velocity: 0.3, threshold: 10 }); throws an error as get() no longer seems to exist on HammerManager.

Is there another way to get the swipe action and set it? I can't seem to find much information in regards to configuring this.


Solution

  • hammer.get("swipe") changed to hammer.Swipe().

    In your case you dont even need to pass parameters because yours are the default.

    For more information see the Docs