Skip to content

Commit

Permalink
Fix radio button example (#547)
Browse files Browse the repository at this point in the history
Radio buttons must use on_update rather than try to handle the click themselves
  • Loading branch information
sgued authored Aug 12, 2024
1 parent 2d17082 commit 1dce70f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions examples/flight_booker/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 1dce70f

Please sign in to comment.