Skip to content

Commit 0c0f3cc

Browse files
committed
fix(tooltip): add check for tooltipTarget
1 parent 3e8926d commit 0c0f3cc

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

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

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -275,9 +275,10 @@ export class IgxTooltipTargetDirective extends IgxToggleActionDirective implemen
275275
return;
276276
}
277277

278-
const tooltipTarget = this.target.tooltipTarget.nativeElement;
278+
const tooltipTarget = this.target.tooltipTarget?.nativeElement;
279279

280-
if (tooltipTarget !== event.target &&
280+
if (tooltipTarget &&
281+
tooltipTarget !== event.target &&
281282
!tooltipTarget.contains(event.target)
282283
) {
283284
this.hideTooltip();
@@ -310,7 +311,7 @@ export class IgxTooltipTargetDirective extends IgxToggleActionDirective implemen
310311
}
311312
});
312313

313-
this.nativeElement.addEventListener('touchstart', this.onTouchStart.bind(this), { passive: true });
314+
this.nativeElement.addEventListener('touchstart', this.onTouchStart = this.onTouchStart.bind(this), { passive: true });
314315
this.target.onDocumentTouchStart = this.onDocumentTouchStart.bind(this);
315316
}
316317

0 commit comments

Comments
 (0)