Skip to content

Commit

Permalink
fix: fix keyboard option navigation skipping all items (#1165)
Browse files Browse the repository at this point in the history
Fixes #1161. Navigating with up or down arrows would always go to first and last option, skipping
everything in between. Caused by missing break statements, probably deleted by accident.

#1161

Co-authored-by: Dino Pejaković <[email protected]>
  • Loading branch information
inoric and inoric authored Apr 17, 2020
1 parent 538df2c commit f47180c
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/mixins/typeAheadPointer.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ export default {
for (let i = this.typeAheadPointer - 1; i >= 0; i--) {
if (this.selectable(this.filteredOptions[i])) {
this.typeAheadPointer = i;
break;
}
}
},
Expand All @@ -39,6 +40,7 @@ export default {
for (let i = this.typeAheadPointer + 1; i < this.filteredOptions.length; i++) {
if (this.selectable(this.filteredOptions[i])) {
this.typeAheadPointer = i;
break;
}
}
},
Expand Down

0 comments on commit f47180c

Please sign in to comment.