Skip to content

Commit

Permalink
fix: Move Command additional props to be declared directly in `Comm…
Browse files Browse the repository at this point in the history
…andProps` type (#31)

* fix: include additional CommandProps in types file
  • Loading branch information
Not-Jayden authored Nov 18, 2023
1 parent 28fe1a7 commit fe60ae1
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 5 deletions.
5 changes: 5 additions & 0 deletions .changeset/bright-kangaroos-explode.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'cmdk-sv': patch
---

fix: move Command additional props to types file
5 changes: 1 addition & 4 deletions src/lib/cmdk/components/Command.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,7 @@
import { createCommand } from '../command.js';
import type { CommandProps } from '../types.js';
type $$Props = CommandProps & {
onKeydown?: (e: KeyboardEvent) => void;
asChild?: boolean;
};
type $$Props = CommandProps;
export let label: $$Props['label'] = undefined;
export let shouldFilter: $$Props['shouldFilter'] = true;
Expand Down
5 changes: 4 additions & 1 deletion src/lib/cmdk/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,10 @@ export type CommandProps = Expand<
ids?: Partial<CommandIds>;
}
> &
HTMLDivAttributes;
HTMLDivAttributes & {
onKeydown?: (e: KeyboardEvent) => void;
asChild?: boolean;
};

export type ListProps = {
/**
Expand Down

0 comments on commit fe60ae1

Please sign in to comment.