From 1dbc8e83cf4a8b864c09cae0445a65c887b33544 Mon Sep 17 00:00:00 2001 From: Mateusz Dionizy <62315827+deronek@users.noreply.github.com> Date: Sat, 24 Feb 2024 21:30:03 +0100 Subject: [PATCH] feat: expose keydown event from Input component (#57) Co-authored-by: Hunter Johnston <64506580+huntabyte@users.noreply.github.com> --- .changeset/dull-panthers-divide.md | 5 +++++ src/lib/cmdk/components/CommandInput.svelte | 1 + src/lib/cmdk/types.ts | 1 + 3 files changed, 7 insertions(+) create mode 100644 .changeset/dull-panthers-divide.md diff --git a/.changeset/dull-panthers-divide.md b/.changeset/dull-panthers-divide.md new file mode 100644 index 0000000..199c50a --- /dev/null +++ b/.changeset/dull-panthers-divide.md @@ -0,0 +1,5 @@ +--- +"cmdk-sv": patch +--- + +Expose keydown event from Input component diff --git a/src/lib/cmdk/components/CommandInput.svelte b/src/lib/cmdk/components/CommandInput.svelte index 6cf21d5..53abffd 100644 --- a/src/lib/cmdk/components/CommandInput.svelte +++ b/src/lib/cmdk/components/CommandInput.svelte @@ -73,6 +73,7 @@ bind:value use:action {...$$restProps} + on:keydown on:input on:focus on:blur diff --git a/src/lib/cmdk/types.ts b/src/lib/cmdk/types.ts index 6b82e2a..a7d4f59 100644 --- a/src/lib/cmdk/types.ts +++ b/src/lib/cmdk/types.ts @@ -248,6 +248,7 @@ export type DialogProps< // export type InputEvents = { + keydown: KeyboardEvent; blur: FocusEvent; input: Event; focus: FocusEvent;