diff --git a/app/components/ChatInput.vue b/app/components/ChatInput.vue index c277a10..12cce1d 100644 --- a/app/components/ChatInput.vue +++ b/app/components/ChatInput.vue @@ -110,7 +110,10 @@ const handleWindowKeyDown = async (event: KeyboardEvent) => { if (event.defaultPrevented) return; if (event.ctrlKey || event.metaKey || event.altKey) return; - if (document.activeElement === document.body) { + const isInteractive = document.activeElement?.closest('input, textarea, button, a, select, [contenteditable="true"]'); + if (isInteractive) return; + + if (!isInteractive) { const isPrintable = event.key.length === 1; if (isPrintable) { diff --git a/app/components/ModelSelector.vue b/app/components/ModelSelector.vue index 3a92160..a003c8d 100644 --- a/app/components/ModelSelector.vue +++ b/app/components/ModelSelector.vue @@ -6,7 +6,8 @@ import type { ModelWithProvider, ProviderWithModels } from '~/composables/useMod import { sortByReleaseDate } from '~/utils/sort'; const { openDialog } = useDialog(); -const { allModels } = await useModels(); +const { allModels } = useModels(); +const { addShortcut } = useKeyboardShortcuts(); const props = defineProps<{ providers: ProviderWithModels[]; @@ -213,6 +214,14 @@ const handleSearchKeyDown = (event: KeyboardEvent) => { break; } }; + +const unbindShortcut = addShortcut(['ctrl', 'shift', 'm'], () => { + toggleDropdown(); +}); + +onUnmounted(() => { + unbindShortcut(); +})