From cd60d0219fbbf4aee293d9957cf9a170a83ef97d Mon Sep 17 00:00:00 2001 From: mikiher Date: Wed, 6 Mar 2024 14:02:15 +0200 Subject: [PATCH] Bring back setInputWidth --- client/components/ui/MultiSelect.vue | 9 +++++++++ client/components/ui/MultiSelectQueryInput.vue | 11 ++++++++++- 2 files changed, 19 insertions(+), 1 deletion(-) diff --git a/client/components/ui/MultiSelect.vue b/client/components/ui/MultiSelect.vue index 7444223e..f1625de0 100644 --- a/client/components/ui/MultiSelect.vue +++ b/client/components/ui/MultiSelect.vue @@ -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 diff --git a/client/components/ui/MultiSelectQueryInput.vue b/client/components/ui/MultiSelectQueryInput.vue index d5fb04b3..65cc8a63 100644 --- a/client/components/ui/MultiSelectQueryInput.vue +++ b/client/components/ui/MultiSelectQueryInput.vue @@ -126,7 +126,16 @@ export default { clearTimeout(this.typingTimeout) this.typingTimeout = setTimeout(() => { this.search() - }, 250) + }, 250) + 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