Skip to content
Snippets Groups Projects
Commit 8bc81164 authored by OZGCloud's avatar OZGCloud
Browse files

OZG-5834 OZG-6134 Change atribute

* From aria-describedby to aria-label
parent b7dde4c5
Branches
Tags
No related merge requests found
......@@ -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);
}
}
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment