From 8bc81164adc9af0395c742cc0d125860ced8973e Mon Sep 17 00:00:00 2001 From: OZGCloud <ozgcloud@mgm-tp.com> Date: Mon, 22 Jul 2024 08:44:05 +0200 Subject: [PATCH] OZG-5834 OZG-6134 Change atribute * From aria-describedby to aria-label --- .../ui/src/lib/ui/mattooltip/mattooltip.directive.ts | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) 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 593d0c45b3..dd6c245e48 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); } } } -- GitLab