Skip to content

Commit d985035

Browse files
committed
fix(tooltip): DAP violation
1 parent 7b709f2 commit d985035

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

src/dialog/tooltip/tooltip.directive.ts

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,11 @@ export class TooltipDirective extends DialogDirective {
5151
// tslint:disable-next-line:no-input-rename
5252
@Input("tooltip-type") tooltipType: "warning" | "error" | "" = "";
5353

54-
@HostBinding("attr.aria-describedby") descriptorId: string;
54+
@HostBinding("attr.aria-describedby") get descriptorId(): string {
55+
if (this.expanded) {
56+
return this.dialogConfig.compID;
57+
}
58+
}
5559

5660
/**
5761
* Creates an instance of `TooltipDirective`.
@@ -73,6 +77,5 @@ export class TooltipDirective extends DialogDirective {
7377
this.dialogConfig.compID = "tooltip-" + TooltipDirective.tooltipCounter;
7478
this.dialogConfig.content = this.ibmTooltip;
7579
this.dialogConfig.type = this.tooltipType;
76-
this.descriptorId = this.dialogConfig.compID;
7780
}
7881
}

0 commit comments

Comments
 (0)