2
0
mirror of https://github.com/frappe/books.git synced 2025-01-09 17:53:56 +00:00

fix: prevent wonky dropdown key scrolling

This commit is contained in:
18alantom 2022-10-25 14:34:28 +05:30
parent 544eb5128d
commit 3edc050cfb

View File

@ -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;