From f47180cdaef50346d619b1d76207d3dee702d4be Mon Sep 17 00:00:00 2001 From: inoric Date: Sat, 18 Apr 2020 00:26:30 +0200 Subject: [PATCH] fix: fix keyboard option navigation skipping all items (#1165) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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ć --- src/mixins/typeAheadPointer.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/mixins/typeAheadPointer.js b/src/mixins/typeAheadPointer.js index 2716634..b878676 100644 --- a/src/mixins/typeAheadPointer.js +++ b/src/mixins/typeAheadPointer.js @@ -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; } } }, @@ -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; } } },