From 3edc050cfb34c0c580a664271e135f762cdedfcb Mon Sep 17 00:00:00 2001 From: 18alantom <2.alan.tom@gmail.com> Date: Tue, 25 Oct 2022 14:34:28 +0530 Subject: [PATCH] fix: prevent wonky dropdown key scrolling --- src/components/Dropdown.vue | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/components/Dropdown.vue b/src/components/Dropdown.vue index 671cb94a..1cfff674 100644 --- a/src/components/Dropdown.vue +++ b/src/components/Dropdown.vue @@ -214,7 +214,9 @@ export default { await this.selectItem(this.items[0]); } }, - highlightItemUp() { + highlightItemUp(e) { + e?.preventDefault(); + this.highlightedIndex -= 1; if (this.highlightedIndex < 0) { this.highlightedIndex = 0; @@ -227,7 +229,9 @@ export default { this.scrollToHighlighted(); }); }, - highlightItemDown() { + highlightItemDown(e) { + e?.preventDefault(); + this.highlightedIndex += 1; if (this.highlightedIndex > this.items.length) { this.highlightedIndex = this.items.length;