Skip to content

Commit 0c00ba5

Browse files
committed
refactor(tooltip): use tooltipTarget mouse handlers
1 parent 028ea97 commit 0c00ba5

File tree

2 files changed

+4
-18
lines changed

2 files changed

+4
-18
lines changed

projects/igniteui-angular/src/lib/directives/tooltip/tooltip-target.directive.ts

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -428,9 +428,6 @@ export class IgxTooltipTargetDirective extends IgxToggleActionDirective implemen
428428
});
429429

430430
this.nativeElement.addEventListener('touchstart', this.onTouchStart = this.onTouchStart.bind(this), { passive: true });
431-
432-
this.target.onShow = this._showOnInteraction.bind(this);
433-
this.target.onHide = this._hideOnInteraction.bind(this);
434431
}
435432

436433
/**

projects/igniteui-angular/src/lib/directives/tooltip/tooltip.directive.ts

Lines changed: 4 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -108,24 +108,13 @@ export class IgxTooltipDirective extends IgxToggleDirective implements OnDestroy
108108
*/
109109
public timeoutId;
110110

111-
/**
112-
* @hidden
113-
*/
114-
public onShow: (event?: Event) => void;
115-
116-
/**
117-
* @hidden
118-
*/
119-
public onHide: (event?: Event) => void;
120-
121-
private _arrowEl: HTMLElement;
122-
private _role: "tooltip" | "status" = "tooltip"
123-
124111
/**
125112
* @hidden
126113
*/
127114
public tooltipTarget: IgxTooltipTargetDirective;
128115

116+
private _arrowEl: HTMLElement;
117+
private _role: 'tooltip' | 'status' = 'tooltip';
129118
private _destroy$ = new Subject<boolean>();
130119

131120
/** @hidden */
@@ -163,15 +152,15 @@ export class IgxTooltipDirective extends IgxToggleDirective implements OnDestroy
163152
*/
164153
@HostListener('mouseenter')
165154
public onMouseEnter() {
166-
this.onShow();
155+
this.tooltipTarget?.onMouseEnter();
167156
}
168157

169158
/**
170159
* @hidden
171160
*/
172161
@HostListener('mouseleave')
173162
public onMouseLeave() {
174-
this.onHide();
163+
this.tooltipTarget?.onMouseLeave();
175164
}
176165

177166
/**

0 commit comments

Comments
 (0)