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
This commit is contained in:
Paul Gschwendtner
2018-09-11 19:45:03 +02:00
committed by Jeremy Elbourn
parent 0389d12309
commit 722dfb3633
+7
View File
@@ -100,6 +100,13 @@ export class GestureConfig extends HammerGestureConfig {
// Overwrite the default `pan` event to use the swipe event.
pan.recognizeWith(swipe);
// Since the slide event threshold is set to zero, the slide recognizer can fire and
// accidentally reset the longpress recognizer. In order to make sure that the two
// recognizers can run simultaneously but don't affect each other, we allow the slide
// recognizer to recognize while a longpress is being processed.
// See: https://github.com/hammerjs/hammer.js/blob/master/src/manager.js#L123-L124
longpress.recognizeWith(slide);
// Add customized gestures to Hammer manager
mc.add([swipe, press, pan, slide, longpress]);