Commit 332b5888 authored by 杨奕's avatar 杨奕 Committed by baiyaaaaa

Scrollbar: return if component gets destroyed in mounted hook (#2588)

* Scrollbar: return if component gets destroyed in mounted hook

* Select: handle paste events in filterable mode
parent 6dd09cc1
......@@ -104,6 +104,7 @@ export default {
update() {
let heightPercentage, widthPercentage;
const wrap = this.wrap;
if (!wrap) return;
heightPercentage = (wrap.clientHeight * 100 / wrap.scrollHeight);
widthPercentage = (wrap.clientWidth * 100 / wrap.scrollWidth);
......
......@@ -59,6 +59,7 @@
@keydown.native.enter.prevent="selectOption"
@keydown.native.esc.prevent="visible = false"
@keydown.native.tab="visible = false"
@paste.native="debouncedOnInputChange"
@mouseenter.native="inputHovering = true"
@mouseleave.native="inputHovering = false"
:icon="iconClass">
......@@ -243,6 +244,8 @@
});
this.hoverIndex = -1;
if (this.multiple && this.filterable) {
this.inputLength = this.$refs.input.value.length * 15 + 20;
this.managePlaceholder();
this.resetInputHeight();
}
if (this.remote && typeof this.remoteMethod === 'function') {
......@@ -651,7 +654,7 @@
this.resetInputHeight();
}
this.$nextTick(() => {
if (this.$refs.reference.$el) {
if (this.$refs.reference && this.$refs.reference.$el) {
this.inputWidth = this.$refs.reference.$el.getBoundingClientRect().width;
}
});
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment