I want to focus to the next item using Arrow keys.
In keydown event handler, I use event.currentTarget.nextSibling
to access the next item.
Is there another way to accomplish this?
In the event handler, I want to use JQuery to do this. How to do this?
<ul>
<li *ngFor = "let work of works" tabindex="-1"
(keydown.ArrowDown)="handleKeyEvent( $event, 'Arrow Down' )">
<div class="guide-label">
<div>{{work.cd}}</div>
<div>{{work.name}}</div>
</div>
</li>
</ul>
export class WorkComponent {
...
handleKeyEvent(event: Event): void {
event.currentTarget.nextSibling.focus();
event.preventDefault();
}
}