From 6df9d4e4611ad9e0b143d1ff55096c596f8922a8 Mon Sep 17 00:00:00 2001 From: mertsincan Date: Tue, 14 Sep 2021 13:42:01 +0300 Subject: [PATCH] Fixed #1516 - Dropdown with filter bug selecting with arrow keys --- src/components/dropdown/Dropdown.vue | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/components/dropdown/Dropdown.vue b/src/components/dropdown/Dropdown.vue index 9be143773..01b2979ba 100755 --- a/src/components/dropdown/Dropdown.vue +++ b/src/components/dropdown/Dropdown.vue @@ -206,20 +206,20 @@ export default { }, getSelectedOption() { let index = this.getSelectedOptionIndex(); - return index !== -1 ? (this.optionGroupLabel ? this.getOptionGroupChildren(this.options[index.group])[index.option]: this.options[index]) : null; + return index !== -1 ? (this.optionGroupLabel ? this.getOptionGroupChildren(this.visibleOptions[index.group])[index.option]: this.visibleOptions[index]) : null; }, getSelectedOptionIndex() { - if (this.modelValue != null && this.options) { + if (this.modelValue != null && this.visibleOptions) { if (this.optionGroupLabel) { - for (let i = 0; i < this.options.length; i++) { - let selectedOptionIndex = this.findOptionIndexInList(this.modelValue, this.getOptionGroupChildren(this.options[i])); + for (let i = 0; i < this.visibleOptions.length; i++) { + let selectedOptionIndex = this.findOptionIndexInList(this.modelValue, this.getOptionGroupChildren(this.visibleOptions[i])); if (selectedOptionIndex !== -1) { return {group: i, option: selectedOptionIndex}; } } } else { - return this.findOptionIndexInList(this.modelValue, this.options); + return this.findOptionIndexInList(this.modelValue, this.visibleOptions); } }