Skip to content

Commit 1852563

Browse files
devversionmmalerba
authored andcommitted
fix(tooltip): custom gesture config not set up (#12941)
* Currently if the `MatTooltip` directive is being used without any other modules that set up our "Material" hammer gesture config, the tooltip will use the default `platform-browser` gesture config and **never** fire the `(longpress)` event. This could have been probably added to #12940, but I figured that out later and should be fine that way too. Related to #12917
1 parent 0c5598c commit 1852563

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

src/lib/tooltip/tooltip-module.ts

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,8 @@ import {OverlayModule} from '@angular/cdk/overlay';
1010
import {A11yModule} from '@angular/cdk/a11y';
1111
import {CommonModule} from '@angular/common';
1212
import {NgModule} from '@angular/core';
13-
import {MatCommonModule} from '@angular/material/core';
13+
import {GestureConfig, MatCommonModule} from '@angular/material/core';
14+
import {HAMMER_GESTURE_CONFIG} from '@angular/platform-browser';
1415
import {
1516
MatTooltip,
1617
TooltipComponent,
@@ -27,6 +28,9 @@ import {
2728
exports: [MatTooltip, TooltipComponent, MatCommonModule],
2829
declarations: [MatTooltip, TooltipComponent],
2930
entryComponents: [TooltipComponent],
30-
providers: [MAT_TOOLTIP_SCROLL_STRATEGY_FACTORY_PROVIDER]
31+
providers: [
32+
MAT_TOOLTIP_SCROLL_STRATEGY_FACTORY_PROVIDER,
33+
{provide: HAMMER_GESTURE_CONFIG, useClass: GestureConfig},
34+
]
3135
})
3236
export class MatTooltipModule {}

0 commit comments

Comments
 (0)