diff --git a/alfa-client/libs/ui/src/lib/ui/mattooltip/mattooltip.directive.ts b/alfa-client/libs/ui/src/lib/ui/mattooltip/mattooltip.directive.ts index 593d0c45b3a996c3eb87d347bfd92553bed9c3fe..dd6c245e4861b990b05e8c4a2b5066c613c90d74 100644 --- a/alfa-client/libs/ui/src/lib/ui/mattooltip/mattooltip.directive.ts +++ b/alfa-client/libs/ui/src/lib/ui/mattooltip/mattooltip.directive.ts @@ -21,8 +21,8 @@ * Die sprachspezifischen Genehmigungen und Beschränkungen * unter der Lizenz sind dem Lizenztext zu entnehmen. */ -import { Directive, ElementRef, Input, OnChanges, OnInit } from '@angular/core'; import { EMPTY_STRING } from '@alfa-client/tech-shared'; +import { Directive, ElementRef, Input, OnChanges, OnInit } from '@angular/core'; /** * Workaround: MatTooltipModule aus Angular 13 schafft es nicht immer, @@ -35,7 +35,7 @@ import { EMPTY_STRING } from '@alfa-client/tech-shared'; */ const titleAttribute: string = 'title'; -const ariaDescribedBy: string = 'aria-describedby'; +const ariaLabel: string = 'aria-label'; @Directive({ selector: '[matTooltip]', @@ -46,8 +46,9 @@ export class MatTooltipDirective implements OnChanges { constructor(private el: ElementRef) {} ngOnChanges(): void { + console.log('changes', this.matTooltip); this.el.nativeElement.setAttribute(titleAttribute, this.matTooltip); - this.el.nativeElement.setAttribute(ariaDescribedBy, this.matTooltip); + this.el.nativeElement.setAttribute(ariaLabel, this.matTooltip); } } @@ -62,7 +63,7 @@ export class MatTooltipDisabledDirective implements OnInit { ngOnInit(): void { if (this.matTooltipDisabled) { this.el.nativeElement.setAttribute(titleAttribute, EMPTY_STRING); - this.el.nativeElement.setAttribute(ariaDescribedBy, EMPTY_STRING); + this.el.nativeElement.setAttribute(ariaLabel, EMPTY_STRING); } } }