From 5c2253be79db7a1044b0d48dd9002ca0d8355f1b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sosth=C3=A8ne=20Gu=C3=A9don?= Date: Sun, 11 Aug 2024 11:16:57 +0200 Subject: [PATCH] Fix radio button example Radio buttons must use on_update rather than try to handle the click themselves --- examples/flight_booker/src/main.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/examples/flight_booker/src/main.rs b/examples/flight_booker/src/main.rs index c185fa33..12141851 100644 --- a/examples/flight_booker/src/main.rs +++ b/examples/flight_booker/src/main.rs @@ -61,13 +61,13 @@ pub fn app_view() -> impl IntoView { move || flight_mode.get(), || "One way flight", ) - .on_click_stop(move |_| flight_mode_set.set(FlightMode::OneWay)), + .on_update(move |v| flight_mode_set.set(v)), labeled_radio_button( FlightMode::Return, move || flight_mode.get(), || "Return flight", ) - .on_click_stop(move |_| flight_mode_set.set(FlightMode::Return)), + .on_update(move |v| flight_mode_set.set(v)), )); let start_date_input = text_input(start_text)