Skip to content

Commit

Permalink
fix: re-throw errors in delegated event listeners
Browse files Browse the repository at this point in the history
  • Loading branch information
Giovanni-Tably committed Feb 29, 2024
1 parent 6a83161 commit 71d8399
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion leptos_dom/src/events.rs
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,10 @@ pub(crate) fn add_delegated_event_listener(
if !maybe_handler.is_undefined() {
let f = maybe_handler
.unchecked_ref::<js_sys::Function>();
let _ = f.call1(&node, &ev);
match f.call1(&node, &ev) {
Ok(_) => {},
Err(e) => wasm_bindgen::throw_val(e),
}

if ev.cancel_bubble() {
return;
Expand Down

0 comments on commit 71d8399

Please sign in to comment.