diff --git a/components/i/search/Ask.vue b/components/i/search/Ask.vue index faefb51310ab2941b493d5b1c58cb5b1a32b9f29..fc384e33aeeffe7f6500177542a51470a879ef36 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) +}