mirror of
https://github.com/ArthurDanjou/ui.git
synced 2026-01-14 20:19:34 +01:00
chore(CommandPalette): allow to disable autoselect (#84)
This commit is contained in:
committed by
GitHub
parent
4ce991652b
commit
2560088b2b
@@ -94,6 +94,10 @@ const props = defineProps({
|
||||
options: {
|
||||
type: Object as PropType<Partial<UseFuseOptions<Command>>>,
|
||||
default: () => ({})
|
||||
},
|
||||
autoselect: {
|
||||
type: Boolean,
|
||||
default: true
|
||||
}
|
||||
})
|
||||
|
||||
@@ -103,7 +107,9 @@ const query = ref('')
|
||||
const comboboxInput = ref<ComponentPublicInstance<HTMLInputElement>>()
|
||||
|
||||
onMounted(() => {
|
||||
activateFirstOption()
|
||||
if (props.autoselect) {
|
||||
activateFirstOption()
|
||||
}
|
||||
})
|
||||
|
||||
const options: ComputedRef<Partial<UseFuseOptions<Command>>> = computed(() => defu({}, props.options, {
|
||||
|
||||
Reference in New Issue
Block a user