Select: fix filter input display in multiple mode

This commit is contained in:
Leopoldthecoder 2017-11-23 11:08:39 +08:00 committed by 杨奕
parent d6c35bffaa
commit e033313608
4 changed files with 10 additions and 6 deletions

View File

@ -368,7 +368,8 @@ Multiple select uses tags to display selected options.
value: 'Option5',
label: 'Option5'
}],
value5: []
value5: [],
value11: []
}
}
}

View File

@ -367,7 +367,8 @@
value: '选项5',
label: '北京烤鸭'
}],
value5: []
value5: [],
value11: []
}
}
}

View File

@ -11,6 +11,7 @@
:style="{ 'max-width': inputWidth - 32 + 'px' }">
<span
class="el-select__multiple-text"
v-show="multipleText"
v-if="collapseTags">
{{ multipleText }}
</span>
@ -65,8 +66,8 @@
@blur="handleBlur"
@mousedown.native="handleMouseDown"
@keyup.native="debouncedOnInputChange"
@keydown.native.down.prevent="navigateOptions('next')"
@keydown.native.up.prevent="navigateOptions('prev')"
@keydown.native.down.stop.prevent="navigateOptions('next')"
@keydown.native.up.stop.prevent="navigateOptions('prev')"
@keydown.native.enter.prevent="selectOption"
@keydown.native.esc.stop.prevent="visible = false"
@keydown.native.tab="visible = false"
@ -375,7 +376,8 @@
});
this.hoverIndex = -1;
if (this.multiple && this.filterable) {
this.inputLength = this.$refs.input.value.length * 15 + 20;
const length = this.$refs.input.value.length * 15 + 20;
this.inputLength = this.collapseTags ? Math.min(50, length) : length;
this.managePlaceholder();
this.resetInputHeight();
}

View File

@ -93,7 +93,7 @@
margin-left: 15px;
color: $--input-color;
font-size: $--font-size-base;
display: block;
display: inline;
@include utils-ellipsis;
}