Skip to content

Commit 722dfb3

Browse files
devversionjelbourn
authored andcommitted
fix(tooltip): not showing up on touch devices (#12940)
* Currently if someone long presses a tooltip trigger on a touch device, the tooltip will not show up. This is because the `longpress` event does reset immediately and not fire if a `slide` event is being recognized. The `slide` event most likely fires most of the time because of a `threshold = 0` (for smooth sliding) Fixes #12917
1 parent 0389d12 commit 722dfb3

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

src/lib/core/gestures/gesture-config.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,13 @@ export class GestureConfig extends HammerGestureConfig {
100100
// Overwrite the default `pan` event to use the swipe event.
101101
pan.recognizeWith(swipe);
102102

103+
// Since the slide event threshold is set to zero, the slide recognizer can fire and
104+
// accidentally reset the longpress recognizer. In order to make sure that the two
105+
// recognizers can run simultaneously but don't affect each other, we allow the slide
106+
// recognizer to recognize while a longpress is being processed.
107+
// See: https://github.com/hammerjs/hammer.js/blob/master/src/manager.js#L123-L124
108+
longpress.recognizeWith(slide);
109+
103110
// Add customized gestures to Hammer manager
104111
mc.add([swipe, press, pan, slide, longpress]);
105112

0 commit comments

Comments
 (0)