From 34d2e88e9f537739b453dcaf4504aa3867094507 Mon Sep 17 00:00:00 2001 From: Arthur DANJOU Date: Thu, 4 Sep 2025 17:11:16 +0200 Subject: [PATCH] fix: add useActiveElement watcher to blur input fields and update package dependencies --- app/components/chat/CommandPalette.vue | 8 ++++++++ bun.lock | 3 +++ package.json | 3 ++- 3 files changed, 13 insertions(+), 1 deletion(-) diff --git a/app/components/chat/CommandPalette.vue b/app/components/chat/CommandPalette.vue index 2ab8280..b0b8119 100644 --- a/app/components/chat/CommandPalette.vue +++ b/app/components/chat/CommandPalette.vue @@ -45,6 +45,13 @@ defineShortcuts({ t: () => toggleDark({ clientX: window.innerWidth / 2, clientY: window.innerHeight }), }) +const activeElement = useActiveElement() +watch(activeElement, () => { + if (activeElement.value instanceof HTMLElement && ['INPUT', 'TEXTAREA'].includes(activeElement.value.tagName)) { + activeElement.value.blur() + } +}) + const modalUi = { content: 'bg-default-30 dark:bg-default/70 backdrop-blur-xl border border-accented/70 max-w-2xl h-100 flex flex-col shadow-raycast', } @@ -107,6 +114,7 @@ function goHome() { :ui="commandPaletteUi" :groups="messages" icon="i-ph-paper-plane-tilt-duotone" + :autofocus="false" :placeholder="t('palette.cmd.placeholder')" @update:model-value="onSelect" @update:open="openMessageModal = $event" diff --git a/bun.lock b/bun.lock index 01a873f..f3aec5a 100644 --- a/bun.lock +++ b/bun.lock @@ -8,6 +8,7 @@ "@iconify-json/devicon": "^1.2.43", "@iconify-json/logos": "^1.2.9", "@iconify-json/ph": "^1.2.2", + "@iconify-json/simple-icons": "^1.2.50", "@iconify-json/twemoji": "^1.2.4", "@iconify-json/vscode-icons": "^1.2.30", "@nuxt/content": "3.6.3", @@ -232,6 +233,8 @@ "@iconify-json/ph": ["@iconify-json/ph@1.2.2", "", { "dependencies": { "@iconify/types": "*" } }, "sha512-PgkEZNtqa8hBGjHXQa4pMwZa93hmfu8FUSjs/nv4oUU6yLsgv+gh9nu28Kqi8Fz9CCVu4hj1MZs9/60J57IzFw=="], + "@iconify-json/simple-icons": ["@iconify-json/simple-icons@1.2.50", "", { "dependencies": { "@iconify/types": "*" } }, "sha512-Z2ggRwKYEBB9eYAEi4NqEgIzyLhu0Buh4+KGzMPD6+xG7mk52wZJwLT/glDPtfslV503VtJbqzWqBUGkCMKOFA=="], + "@iconify-json/twemoji": ["@iconify-json/twemoji@1.2.4", "", { "dependencies": { "@iconify/types": "*" } }, "sha512-REYJeXhzaLktNe32DxJJf3t65sYC5KO9K0Jh+RApXRBAo1/IB+jBqd8rny2sXci+wtQLBEfD4z4AGCLBrTMGWA=="], "@iconify-json/vscode-icons": ["@iconify-json/vscode-icons@1.2.30", "", { "dependencies": { "@iconify/types": "*" } }, "sha512-dlTOc8w4a8/QNumZzMve+APJa6xQVXPZwo8qBk/MaYfY42NPrQT83QXkbTWKDkuEu/xgHPXvKZZBL7Yy12vYQw=="], diff --git a/package.json b/package.json index 0d88eff..8b76f68 100644 --- a/package.json +++ b/package.json @@ -4,7 +4,7 @@ "private": true, "scripts": { "build": "nuxt build", - "dev": "nuxt dev", + "dev": "nuxt dev --host", "generate": "nuxt generate", "preview": "nuxt preview", "postinstall": "nuxt prepare", @@ -16,6 +16,7 @@ "@iconify-json/devicon": "^1.2.43", "@iconify-json/logos": "^1.2.9", "@iconify-json/ph": "^1.2.2", + "@iconify-json/simple-icons": "^1.2.50", "@iconify-json/twemoji": "^1.2.4", "@iconify-json/vscode-icons": "^1.2.30", "@nuxt/content": "3.6.3",