From 71d8399074df57425724a68e9e18dfcf07fd98fc 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..cd73d7602d 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); + match f.call1(&node, &ev) { + Ok(_) => {}, + Err(e) => wasm_bindgen::throw_val(e), + } if ev.cancel_bubble() { return;