Update select.vue

pull/8583/head
杨奕 2017-11-25 20:50:58 +08:00
parent 4b6f6cc885
commit 95fe0fd2d8
1 changed files with 4 additions and 3 deletions

View File

@ -495,9 +495,10 @@
if (!this.$refs.reference) return;
let inputChildNodes = this.$refs.reference.$el.childNodes;
let input = [].filter.call(inputChildNodes, item => item.tagName === 'INPUT')[0];
const tagsClientHeight = this.$refs.tags && this.$refs.tags.clientHeight || 0;
const defaultSize = sizeMap[this.size || 'small'];
input.style.height = Math.max(tagsClientHeight, defaultSize) + 6 + 'px';
const tags = this.$refs.tags;
input.style.height = this.selected.length === 0
? (sizeMap[this.size] || 36) + 'px'
: Math.max(tags ? (tags.clientHeight + 6) : 0, sizeMap[this.size] || 36) + 'px';
if (this.visible && this.emptyText !== false) {
this.broadcast('ElSelectDropdown', 'updatePopper');
}