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

pull/10946/head
杨奕 2018-04-29 18:12:02 +08:00 committed by GitHub
parent 16dc174a8d
commit 1aed314527
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 2 deletions

View File

@ -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 {
!option.visible) { !option.visible) {
this.navigateOptions(direction); this.navigateOptions(direction);
} }
this.$nextTick(() => this.scrollToOption(this.hoverOption));
} }
this.$nextTick(() => this.scrollToOption(this.hoverOption));
} }
} }
}; };