From 9b122deca024910775b1e60a67ab400ebfb05c38 Mon Sep 17 00:00:00 2001 From: Peter Hanssens Date: Tue, 23 Sep 2025 11:13:58 +1000 Subject: [PATCH] fix: Fix command component compilation errors - Fix event handler type mismatch by using Event instead of InputEvent - Add JsCast import for dyn_into method - Remove problematic aria-level attribute - All compilation errors resolved --- .../command/src/default_components/command_input.rs | 9 ++++++--- .../command/src/default_components/command_items.rs | 1 - 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/packages/leptos/command/src/default_components/command_input.rs b/packages/leptos/command/src/default_components/command_input.rs index c058193..4bedcc0 100644 --- a/packages/leptos/command/src/default_components/command_input.rs +++ b/packages/leptos/command/src/default_components/command_input.rs @@ -1,4 +1,5 @@ use leptos::prelude::*; +use leptos::wasm_bindgen::JsCast; use tailwind_fuse::tw_merge; const COMMAND_INPUT_CLASS: &str = "flex items-center border-b px-3"; @@ -23,9 +24,11 @@ pub fn CommandInput( class.get().unwrap_or_default() )); - let handle_input = move |ev: leptos::ev::InputEvent| { - let value = event_target_value(&ev); - context.search.set(value); + let handle_input = move |ev: leptos::ev::Event| { + if let Ok(input_ev) = ev.dyn_into::() { + let value = event_target_value(&input_ev); + context.search.set(value); + } }; view! { diff --git a/packages/leptos/command/src/default_components/command_items.rs b/packages/leptos/command/src/default_components/command_items.rs index 184dc3f..8810ebf 100644 --- a/packages/leptos/command/src/default_components/command_items.rs +++ b/packages/leptos/command/src/default_components/command_items.rs @@ -49,7 +49,6 @@ pub fn CommandGroupHeading( id=id.get() style=style.get() role="heading" - aria-level="3" > {children()}