Skip to content

Commit

Permalink
refactoring ad3b03c
Browse files Browse the repository at this point in the history
  • Loading branch information
Clem-Fern committed Aug 17, 2023
1 parent ad3b03c commit 634d88d
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions tabby-core/src/components/selectorModal.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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--
Expand Down

0 comments on commit 634d88d

Please sign in to comment.