From 421d9370379f0c8a2b4518f3257bfb25b75751fd Mon Sep 17 00:00:00 2001 From: Emilia Date: Tue, 6 Jun 2023 18:45:24 -0400 Subject: [PATCH] Fix bug for new plate modal The close callback wasn't triggered when the modal's onclose event fired. --- src/components/new_plate_dialog.rs | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/components/new_plate_dialog.rs b/src/components/new_plate_dialog.rs index dcfb117..cf72834 100644 --- a/src/components/new_plate_dialog.rs +++ b/src/components/new_plate_dialog.rs @@ -60,6 +60,13 @@ pub fn NewPlateDialog(props: &NewPlateDialogProps) -> Html { }) }; + let onclose = { + let close_callback = props.close_callback.clone(); + Callback::from(move |e: Event| { + close_callback.emit(()); + }) + }; + // This whole section is optional, only if you want the backdrop let dialog_ref = use_node_ref(); { @@ -78,7 +85,7 @@ pub fn NewPlateDialog(props: &NewPlateDialogProps) -> Html { } html! { - +

{"Create a plate:"}