Press n or j to go to the next uncovered block, b, p or k for the previous block.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 | 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 149x 149x 149x 1x | import { Directive, ElementRef, Input } from '@angular/core'; import { IndexedItem } from '../utils/internal-utils'; import { Item } from '../utils/util.types'; @Directive({ selector: '[data-gc-combobox-option]', standalone: false, }) export class ComboBoxOptionDirective<T, I extends Item> { @Input('data-gc-combobox-option') public item: IndexedItem<T, I> | undefined; constructor(private readonly el: ElementRef) {} scrollIntoView(): void { const element = this.el.nativeElement as HTMLElement; element.scrollIntoView({ block: 'nearest', inline: 'nearest' }); } } |