diff --git a/projects/angular/src/forms/common/label.ts b/projects/angular/src/forms/common/label.ts index 0e5fd93815..5af06f05d9 100644 --- a/projects/angular/src/forms/common/label.ts +++ b/projects/angular/src/forms/common/label.ts @@ -5,6 +5,7 @@ */ import { + ContentChild, Directive, ElementRef, HostBinding, @@ -17,6 +18,7 @@ import { } from '@angular/core'; import { Subscription } from 'rxjs'; +import { ClrSignpost } from '../../popover'; import { ControlIdService } from './providers/control-id.service'; import { LayoutService } from './providers/layout.service'; import { NgControlService } from './providers/ng-control.service'; @@ -25,6 +27,8 @@ import { NgControlService } from './providers/ng-control.service'; selector: 'label', }) export class ClrLabel implements OnInit, OnDestroy { + @ContentChild(ClrSignpost, { read: ElementRef }) signpost: ElementRef; + @Input('for') @HostBinding('attr.for') forAttr: string; private enableGrid = true; @@ -49,7 +53,7 @@ export class ClrLabel implements OnInit, OnDestroy { */ @HostListener('click', ['$event']) onClick(event) { - if (event.target.hasAttribute('clrSignpostTrigger')) { + if (this.signpost.nativeElement.contains(event.target)) { event.preventDefault(); } }