Update selectorModal.component.ts

This commit is contained in:
Eugene Pankov 2021-10-04 07:13:50 +02:00
parent 4a1d8cdd0d
commit a26b30f0bc

View File

@ -29,9 +29,11 @@ export class SelectorModalComponent<T> {
@HostListener('keyup', ['$event']) onKeyUp (event: KeyboardEvent): void {
if (event.key === 'ArrowUp') {
this.selectedIndex--
event.preventDefault()
}
if (event.key === 'ArrowDown') {
this.selectedIndex++
event.preventDefault()
}
if (event.key === 'Enter') {
this.selectOption(this.filteredOptions[this.selectedIndex])