mirror of
https://github.com/Eugeny/tabby
synced 2025-03-04 15:17:17 +00:00
refactoring ad3b03cb83
This commit is contained in:
parent
ad3b03cb83
commit
634d88d220
1 changed files with 2 additions and 3 deletions
|
@ -33,11 +33,10 @@ export class SelectorModalComponent<T> {
|
|||
this.close()
|
||||
} else if (this.filteredOptions.length > 0) {
|
||||
if (event.key === 'PageUp' || event.key === 'ArrowUp' && event.metaKey) {
|
||||
this.selectedIndex -= Math.min(10, this.selectedIndex === 0 ? 1 : this.selectedIndex)
|
||||
this.selectedIndex -= Math.min(10, Math.max(1, this.selectedIndex))
|
||||
event.preventDefault()
|
||||
} else if (event.key === 'PageDown' || event.key === 'ArrowDown' && event.metaKey) {
|
||||
const newI = this.filteredOptions.length - this.selectedIndex - 1
|
||||
this.selectedIndex += Math.min(10, newI === 0 ? 1 : newI)
|
||||
this.selectedIndex += Math.min(10, Math.max(1, this.filteredOptions.length - this.selectedIndex - 1))
|
||||
event.preventDefault()
|
||||
} else if (event.key === 'ArrowUp') {
|
||||
this.selectedIndex--
|
||||
|
|
Loading…
Add table
Reference in a new issue