diff --git a/client/components/ui/MultiSelect.vue b/client/components/ui/MultiSelect.vue index 3644f4ab..f1625de0 100644 --- a/client/components/ui/MultiSelect.vue +++ b/client/components/ui/MultiSelect.vue @@ -11,7 +11,7 @@ {{ item }} - + @@ -110,6 +110,15 @@ export default { this.typingTimeout = setTimeout(() => { this.currentSearch = this.textInput }, 100) + this.setInputWidth() + }, + setInputWidth() { + setTimeout(() => { + var value = this.$refs.input.value + var len = value.length * 7 + 24 + this.$refs.input.style.width = len + 'px' + this.recalcMenuPos() + }, 50) }, recalcMenuPos() { if (!this.menu || !this.$refs.inputWrapper) return @@ -199,7 +208,10 @@ export default { e.stopPropagation() e.preventDefault() } - if (this.$refs.input) this.$refs.input.focus() + if (this.$refs.input) { + this.$refs.input.style.width = '24px' + this.$refs.input.focus() + } var newSelected = null if (this.selected.includes(itemValue)) { @@ -252,6 +264,7 @@ export default { } else { this.insertNewItem(this.textInput) } + if (this.$refs.input) this.$refs.input.style.width = '24px' }, scroll() { this.recalcMenuPos() diff --git a/client/components/ui/MultiSelectQueryInput.vue b/client/components/ui/MultiSelectQueryInput.vue index 54de7584..65cc8a63 100644 --- a/client/components/ui/MultiSelectQueryInput.vue +++ b/client/components/ui/MultiSelectQueryInput.vue @@ -14,7 +14,7 @@