Commit 1aed3145 authored by 杨奕's avatar 杨奕 Committed by GitHub

Select: fix infinite loop of keyboard navigation when all filtered options are disabled (#10945)

parent 16dc174a
...@@ -7,7 +7,7 @@ export default { ...@@ -7,7 +7,7 @@ export default {
computed: { computed: {
optionsAllDisabled() { optionsAllDisabled() {
return this.options.length === this.options.filter(item => item.disabled === true).length; return this.options.filter(option => option.visible).every(option => option.disabled);
} }
}, },
...@@ -47,8 +47,8 @@ export default { ...@@ -47,8 +47,8 @@ export default {
!option.visible) { !option.visible) {
this.navigateOptions(direction); this.navigateOptions(direction);
} }
this.$nextTick(() => this.scrollToOption(this.hoverOption));
} }
this.$nextTick(() => this.scrollToOption(this.hoverOption));
} }
} }
}; };
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment