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
This commit is contained in:
Peter Hanssens
2025-09-23 11:13:58 +10:00
parent 0ba8e1ec1a
commit 9b122deca0
2 changed files with 6 additions and 4 deletions

View File

@@ -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::<leptos::ev::InputEvent>() {
let value = event_target_value(&input_ev);
context.search.set(value);
}
};
view! {

View File

@@ -49,7 +49,6 @@ pub fn CommandGroupHeading(
id=id.get()
style=style.get()
role="heading"
aria-level="3"
>
{children()}
</div>