mirror of
https://github.com/tenrok/vue-select.git
synced 2026-06-22 10:30:34 +03:00
fix: fix keyboard option navigation skipping all items (#1165)
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ć <dino.pejakovic@voxdiversa.hr>
This commit is contained in:
@@ -26,6 +26,7 @@ export default {
|
|||||||
for (let i = this.typeAheadPointer - 1; i >= 0; i--) {
|
for (let i = this.typeAheadPointer - 1; i >= 0; i--) {
|
||||||
if (this.selectable(this.filteredOptions[i])) {
|
if (this.selectable(this.filteredOptions[i])) {
|
||||||
this.typeAheadPointer = i;
|
this.typeAheadPointer = i;
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@@ -39,6 +40,7 @@ export default {
|
|||||||
for (let i = this.typeAheadPointer + 1; i < this.filteredOptions.length; i++) {
|
for (let i = this.typeAheadPointer + 1; i < this.filteredOptions.length; i++) {
|
||||||
if (this.selectable(this.filteredOptions[i])) {
|
if (this.selectable(this.filteredOptions[i])) {
|
||||||
this.typeAheadPointer = i;
|
this.typeAheadPointer = i;
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|||||||
Reference in New Issue
Block a user