diff --git a/.changeset/brave-meals-build.md b/.changeset/brave-meals-build.md new file mode 100644 index 0000000..9211ff5 --- /dev/null +++ b/.changeset/brave-meals-build.md @@ -0,0 +1,5 @@ +--- +'cmdk-sv': patch +--- + +fix: select first value after search diff --git a/src/lib/cmdk/command.ts b/src/lib/cmdk/command.ts index 45508eb..90d0c59 100644 --- a/src/lib/cmdk/command.ts +++ b/src/lib/cmdk/command.ts @@ -244,6 +244,7 @@ export function createCommand(props: CommandProps) { tick().then(() => state.update((curr) => { curr.value = selectFirstItem() ?? ''; + props.onValueChange?.(curr.value); return curr; }) );