Commit a7cebb97b3880c8109cb67cb760aa4e83f340454

Authored by Aresn
Committed by GitHub
2 parents 4c006ad7 2fa83db1

Merge pull request #4993 from subying/patch-1

fix: dropdown位置自动调整后,选项列表的长度发生改变后,dropdown位置不会自动计算
Showing 1 changed file with 4 additions and 0 deletions   Show diff stats
src/components/select/select.vue
@@ -750,6 +750,10 @@ @@ -750,6 +750,10 @@
750 if (this.slotOptions && this.slotOptions.length === 0){ 750 if (this.slotOptions && this.slotOptions.length === 0){
751 this.query = ''; 751 this.query = '';
752 } 752 }
  753 +
  754 + // 当 dropdown 一开始在控件下部显示,而滚动页面后变成在上部显示,如果选项列表的长度由内部动态变更了(搜索情况)
  755 + // dropdown 的位置不会重新计算,需要重新计算
  756 + this.broadcast('Drop', 'on-update-popper');
753 }, 757 },
754 visible(state){ 758 visible(state){
755 this.$emit('on-open-change', state); 759 this.$emit('on-open-change', state);