Refactor #5106 - OrderList improvements
parent
3b764469fd
commit
a91450bbc5
|
@ -193,7 +193,7 @@ export default {
|
||||||
this.focusedOptionIndex = index;
|
this.focusedOptionIndex = index;
|
||||||
},
|
},
|
||||||
onArrowDownKey(event) {
|
onArrowDownKey(event) {
|
||||||
const optionIndex = this.focusedOptionIndex !== -1 ? this.findNextOptionIndex(this.focusedOptionIndex) : this.findFirstSelectedOptionIndex();
|
const optionIndex = this.focusedOptionIndex !== -1 ? this.findNextOptionIndex() : this.findFirstSelectedOptionIndex();
|
||||||
|
|
||||||
this.changeFocusedOptionIndex(optionIndex);
|
this.changeFocusedOptionIndex(optionIndex);
|
||||||
|
|
||||||
|
@ -204,7 +204,7 @@ export default {
|
||||||
event.preventDefault();
|
event.preventDefault();
|
||||||
},
|
},
|
||||||
onArrowUpKey(event) {
|
onArrowUpKey(event) {
|
||||||
const optionIndex = this.focusedOptionIndex !== -1 ? this.findPrevOptionIndex(this.focusedOptionIndex) : this.findLastSelectedOptionIndex();
|
const optionIndex = this.focusedOptionIndex !== -1 ? this.findPrevOptionIndex() : this.findLastSelectedOptionIndex();
|
||||||
|
|
||||||
this.changeFocusedOptionIndex(optionIndex);
|
this.changeFocusedOptionIndex(optionIndex);
|
||||||
|
|
||||||
|
@ -312,13 +312,13 @@ export default {
|
||||||
|
|
||||||
return [...items].findIndex((link) => link.id === id);
|
return [...items].findIndex((link) => link.id === id);
|
||||||
},
|
},
|
||||||
findNextOptionIndex(id) {
|
findNextOptionIndex() {
|
||||||
const matchedOptionIndex = this.findMatchedOptionIndex(id);
|
const matchedOptionIndex = this.findMatchedOptionIndex();
|
||||||
|
|
||||||
return matchedOptionIndex > -1 ? matchedOptionIndex + 1 : 0;
|
return matchedOptionIndex > -1 ? matchedOptionIndex + 1 : 0;
|
||||||
},
|
},
|
||||||
findPrevOptionIndex(id) {
|
findPrevOptionIndex() {
|
||||||
const matchedOptionIndex = this.findMatchedOptionIndex(id);
|
const matchedOptionIndex = this.findMatchedOptionIndex();
|
||||||
|
|
||||||
return matchedOptionIndex > -1 ? matchedOptionIndex - 1 : 0;
|
return matchedOptionIndex > -1 ? matchedOptionIndex - 1 : 0;
|
||||||
},
|
},
|
||||||
|
|
Loading…
Reference in New Issue