mirror of
https://github.com/bitwarden/browser
synced 2025-12-11 13:53:34 +00:00
* revert using tooltip in title directive * add back tooltip delay from revert * add back label to carousel buttons * fix documentation that does not need reverted * remove unnecessary label attr
24 lines
703 B
TypeScript
24 lines
703 B
TypeScript
import { Directive, effect, ElementRef, input } from "@angular/core";
|
|
|
|
import { setA11yTitleAndAriaLabel } from "./set-a11y-title-and-aria-label";
|
|
|
|
@Directive({
|
|
selector: "[appA11yTitle]",
|
|
})
|
|
export class A11yTitleDirective {
|
|
readonly title = input.required<string>({ alias: "appA11yTitle" });
|
|
|
|
constructor(private el: ElementRef) {
|
|
const originalTitle = this.el.nativeElement.getAttribute("title");
|
|
const originalAriaLabel = this.el.nativeElement.getAttribute("aria-label");
|
|
|
|
effect(() => {
|
|
setA11yTitleAndAriaLabel({
|
|
element: this.el.nativeElement,
|
|
title: originalTitle ?? this.title(),
|
|
label: originalAriaLabel ?? this.title(),
|
|
});
|
|
});
|
|
}
|
|
}
|