You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 

17 lines
516 B

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});
}
}