@@ -54,7 +54,8 @@ describe('MatTooltip', () => {
54
54
ScrollableTooltipDemo ,
55
55
OnPushTooltipDemo ,
56
56
DynamicTooltipsDemo ,
57
- TooltipOnTextFields
57
+ TooltipOnTextFields ,
58
+ TooltipOnDraggableElement ,
58
59
] ,
59
60
providers : [
60
61
{ provide : Platform , useFactory : ( ) => platform } ,
@@ -795,6 +796,15 @@ describe('MatTooltip', () => {
795
796
expect ( instance . textarea . nativeElement . style . userSelect ) . toBeFalsy ( ) ;
796
797
expect ( instance . textarea . nativeElement . style . webkitUserSelect ) . toBeFalsy ( ) ;
797
798
} ) ;
799
+
800
+ it ( 'should clear the `-webkit-user-drag` on draggable elements' , ( ) => {
801
+ const fixture = TestBed . createComponent ( TooltipOnDraggableElement ) ;
802
+
803
+ fixture . detectChanges ( ) ;
804
+
805
+ expect ( fixture . componentInstance . button . nativeElement . style . webkitUserDrag ) . toBeFalsy ( ) ;
806
+ } ) ;
807
+
798
808
} ) ;
799
809
800
810
} ) ;
@@ -900,6 +910,20 @@ class TooltipOnTextFields {
900
910
@ViewChild ( 'textarea' ) textarea : ElementRef ;
901
911
}
902
912
913
+ @Component ( {
914
+ template : `
915
+ <button
916
+ #button
917
+ style="-webkit-user-drag: none;"
918
+ draggable="true"
919
+ matTooltip="Drag me"></button>
920
+ ` ,
921
+ } )
922
+ class TooltipOnDraggableElement {
923
+ @ViewChild ( 'button' ) button : ElementRef ;
924
+ }
925
+
926
+
903
927
/** Asserts whether a tooltip directive has a tooltip instance. */
904
928
function assertTooltipInstance ( tooltip : MatTooltip , shouldExist : boolean ) : void {
905
929
// Note that we have to cast this to a boolean, because Jasmine will go into an infinite loop
0 commit comments