From 3207c382d368f0085dc06428724cdd7f54e2d2ea Mon Sep 17 00:00:00 2001 From: deronek Date: Wed, 3 Jul 2024 18:05:38 +0200 Subject: [PATCH 1/2] fix: select first value after search --- src/lib/cmdk/command.ts | 1 + 1 file changed, 1 insertion(+) 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; }) ); From d2137f9982ccdbbfe71aea90deb03d77c326ff68 Mon Sep 17 00:00:00 2001 From: deronek Date: Wed, 3 Jul 2024 18:20:24 +0200 Subject: [PATCH 2/2] Add changeset --- .changeset/brave-meals-build.md | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 .changeset/brave-meals-build.md 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