From 1e9f7fcdbc57751995f6534a0627484c07ad0f5f Mon Sep 17 00:00:00 2001 From: Aresn Date: Fri, 31 May 2024 16:20:55 +0800 Subject: [PATCH] hack --- components/i/search/Ask.vue | 35 +++++++++++++++++++++++++++-------- 1 file changed, 27 insertions(+), 8 deletions(-) diff --git a/components/i/search/Ask.vue b/components/i/search/Ask.vue index faefb51..fc384e3 100644 --- a/components/i/search/Ask.vue +++ b/components/i/search/Ask.vue @@ -17,6 +17,8 @@ :padded="false" variant="none" maxlength="2000" + @focus="handleInputFocus" + @blur="handleInputBlur" />
{ + const base = { + body: { + padding: '', + base: 'flex items-end has-[textarea[rows="1"]]:items-center pl-4 pr-1 py-1 gap-2' + }, + // base: 'transition-[width] w-3/5 has-[textarea:focus]:w-full has-[button:focus]:w-full', + rounded: 'rounded has-[textarea[rows="1"]]:rounded-full' + } + if (isFocus.value) { + base.base = 'transition-[width] w-full' + } else { + base.base = 'transition-[width] w-3/5' + } + return base +}) defineShortcuts({ meta_enter: { usingInput: 'queryInput', @@ -96,4 +107,12 @@ function handleAsk () { handleBlur() } const queryInput = ref(null) +function handleInputFocus () { + isFocus.value = true +} +function handleInputBlur () { + setTimeout(() => { + isFocus.value = false + }, 100) +} -- GitLab