Closed scarryaa closed 4 months ago
A minimal example tested outside of Tauri isn't working either -- nothing is printed to the console.
fn main() {
sycamore::render(|| view! {
input(on:keydown=move |event: KeyboardEvent| {
let event: KeyboardEvent = event.unchecked_into();
println!("{}", event.code());
} ) { "Hello, World!" }
});
}
Neither does this:
fn main() {
sycamore::render(|| view! {
input(on:input=move |event: Event| {
println!("{:?}", event);
}) { "Hello, World!" }
});
}
Closing this issue -- I realized I was using the wrong thing, println!
instead of something like console::log_1(&JsValue::from_str(&key))
, which works correctly.
Describe the bug Keydown event not firing on textarea.
To Reproduce Steps to reproduce the behavior:
cargo tauri dev
Expected behavior Keydown event should log to console, but no output is visible.
Screenshots N/A
Environment
Additional context I'm not sure if I am doing something wrong, or if this is indeed a bug. I changed the textarea element to a div, same issue. I have a on:click event on another div that is working fine, so I don't know what the issue here is.
Strangely, event.preventDefault() is working, but nothing else beyond that runs.