From 2560088b2ba3be151bb312e0f2778943e2580fe0 Mon Sep 17 00:00:00 2001 From: Sylvain Marroufin Date: Wed, 5 Oct 2022 15:10:51 +0200 Subject: [PATCH] chore(CommandPalette): allow to disable autoselect (#84) --- src/runtime/components/navigation/CommandPalette.vue | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/runtime/components/navigation/CommandPalette.vue b/src/runtime/components/navigation/CommandPalette.vue index eb7e9d70..8b4e7493 100644 --- a/src/runtime/components/navigation/CommandPalette.vue +++ b/src/runtime/components/navigation/CommandPalette.vue @@ -94,6 +94,10 @@ const props = defineProps({ options: { type: Object as PropType>>, default: () => ({}) + }, + autoselect: { + type: Boolean, + default: true } }) @@ -103,7 +107,9 @@ const query = ref('') const comboboxInput = ref>() onMounted(() => { - activateFirstOption() + if (props.autoselect) { + activateFirstOption() + } }) const options: ComputedRef>> = computed(() => defu({}, props.options, {