mirror of https://github.com/ghostfolio/ghostfolio
2 changed files with 18 additions and 15 deletions
@ -0,0 +1,17 @@ |
|||
import { FocusableOption } from "@angular/cdk/a11y"; |
|||
import { Directive, ElementRef, HostBinding } from "@angular/core"; |
|||
|
|||
@Directive({ |
|||
selector: '[carousel-item]', |
|||
standalone: true, |
|||
}) |
|||
export class CarouselItem implements FocusableOption { |
|||
@HostBinding('attr.role') readonly role = 'listitem'; |
|||
@HostBinding('tabindex') tabindex = '-1'; |
|||
|
|||
constructor(readonly element: ElementRef<HTMLElement>) {} |
|||
|
|||
focus(): void { |
|||
this.element.nativeElement.focus({preventScroll: true}); |
|||
} |
|||
} |
Loading…
Reference in new issue