Select: fix dropdownUl undefined bug (#2120)

pull/2124/head
杨奕 2016-12-30 18:10:57 +08:00 committed by cinwell.li
parent b9eed734e2
commit 308ae62cb3
2 changed files with 7 additions and 7 deletions

View File

@ -48,6 +48,7 @@
:size="size"
:disabled="disabled"
:readonly="!filterable || multiple"
:validate-event="false"
@focus="toggleMenu"
@click="handleIconClick"
@mousedown.native="handleMouseDown"
@ -223,13 +224,13 @@
} else {
this.currentPlaceholder = this.cachedPlaceHolder;
}
this.dispatch('ElFormItem', 'el.form.change', val);
}
this.setSelected();
if (this.filterable && !this.multiple) {
this.inputLength = 20;
}
this.$emit('change', val);
this.dispatch('ElFormItem', 'el.form.change', val);
},
query(val) {
@ -294,8 +295,7 @@
}
}
if (!this.dropdownUl) {
let dropdownChildNodes = this.$refs.popper.$el.childNodes;
this.dropdownUl = [].filter.call(dropdownChildNodes, item => item.tagName === 'UL')[0];
this.dropdownUl = this.$refs.popper.$el.querySelector('.el-select-dropdown__wrap');
}
if (!this.multiple && this.dropdownUl) {
this.setOverflow();

View File

@ -33,6 +33,10 @@
}
}
}
.el-scrollbar.is-empty .el-select-dropdown__list{
padding: 0;
}
}
@b select-dropdown__empty {
@ -53,9 +57,5 @@
padding: var(--select-dropdown-padding);
margin: 0;
box-sizing: border-box;
@when empty {
padding: 0;
}
}
}