diff --git a/src/runtime/components/navigation/CommandPalette.vue b/src/runtime/components/navigation/CommandPalette.vue index 8758b074..c45d56cd 100644 --- a/src/runtime/components/navigation/CommandPalette.vue +++ b/src/runtime/components/navigation/CommandPalette.vue @@ -2,7 +2,6 @@
@@ -43,7 +42,6 @@ import { defu } from 'defu' import type { UseFuseOptions } from '@vueuse/integrations/useFuse' import type { Group, Command } from '../../types/command-palette' import CommandPaletteGroup from './CommandPaletteGroup.vue' -import { useRouter } from '#imports' const props = defineProps({ modelValue: { @@ -54,10 +52,6 @@ const props = defineProps({ type: Boolean, default: false }, - nullable: { - type: Boolean, - default: false - }, groups: { type: Array as PropType, default: () => [] @@ -124,16 +118,14 @@ function activateFirstOption () { }, 0) } -function onSelect (option: Command) { - if (option.disabled) { - return - } - +function onSelect (option: Command | Command[]) { emit('update:modelValue', option) - // waiting for modal to be closed - if (!option.prevent) { - query.value = '' + // Clear input after selection + if (!props.multiple) { + setTimeout(() => { + query.value = '' + }, 0) } } diff --git a/src/runtime/types/command-palette.d.ts b/src/runtime/types/command-palette.d.ts index afbbd104..00fd87aa 100644 --- a/src/runtime/types/command-palette.d.ts +++ b/src/runtime/types/command-palette.d.ts @@ -9,7 +9,6 @@ export interface Command { avatar?: string chip?: string disabled?: boolean - prevent?: boolean shortcuts?: string[] }