mirror of
https://github.com/cloud-shuttle/leptos-shadcn-ui.git
synced 2025-12-22 22:00:00 +00:00
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:
@@ -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! {
|
||||
|
||||
@@ -49,7 +49,6 @@ pub fn CommandGroupHeading(
|
||||
id=id.get()
|
||||
style=style.get()
|
||||
role="heading"
|
||||
aria-level="3"
|
||||
>
|
||||
{children()}
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user