Skip to content

Commit

Permalink
fix: select first value after search (#83)
Browse files Browse the repository at this point in the history
  • Loading branch information
deronek authored Jul 6, 2024
1 parent e097719 commit 0529aaf
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
5 changes: 5 additions & 0 deletions .changeset/brave-meals-build.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'cmdk-sv': patch
---

fix: select first value after search
1 change: 1 addition & 0 deletions src/lib/cmdk/command.ts
Original file line number Diff line number Diff line change
Expand Up @@ -244,6 +244,7 @@ export function createCommand(props: CommandProps) {
tick().then(() =>
state.update((curr) => {
curr.value = selectFirstItem() ?? '';
props.onValueChange?.(curr.value);
return curr;
})
);
Expand Down

0 comments on commit 0529aaf

Please sign in to comment.