From 25fd8ea57c1b948057c3eaeafe4cb69962785f4e Mon Sep 17 00:00:00 2001 From: Giovanni <88086644+Giovanni-Tably@users.noreply.github.com> Date: Mon, 15 Jan 2024 14:52:19 +0000 Subject: [PATCH] fix: re-throw errors in delegated event listeners --- leptos_dom/src/events.rs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/leptos_dom/src/events.rs b/leptos_dom/src/events.rs index 8d50a3cbf0..91af06ec13 100644 --- a/leptos_dom/src/events.rs +++ b/leptos_dom/src/events.rs @@ -150,7 +150,10 @@ pub(crate) fn add_delegated_event_listener( if !maybe_handler.is_undefined() { let f = maybe_handler .unchecked_ref::(); - let _ = f.call1(&node, &ev); + + if let Err(e) = f.call1(&node, &ev) { + wasm_bindgen::throw_val(e); + } if ev.cancel_bubble() { return;