fixed Select bug when options is null and keydown up or down

This commit is contained in:
梁灏 2018-02-09 16:07:24 +08:00
parent f0c2af9d2d
commit 500694ba39
2 changed files with 61 additions and 35 deletions

View file

@ -556,6 +556,7 @@
},
resetScrollTop () {
const index = this.focusIndex - 1;
if (!this.optionInstances.length) return;
let bottomOverflowDistance = this.optionInstances[index].$el.getBoundingClientRect().bottom - this.$refs.dropdown.$el.getBoundingClientRect().bottom;
let topOverflowDistance = this.optionInstances[index].$el.getBoundingClientRect().top - this.$refs.dropdown.$el.getBoundingClientRect().top;