diff --git a/src/components/chips.rs b/src/components/chips.rs index a67d5cb..7504971 100644 --- a/src/components/chips.rs +++ b/src/components/chips.rs @@ -28,13 +28,20 @@ pub fn Chip( #[prop()] checked: Signal, #[prop(optional)] disabled: RwSignal, ) -> impl IntoView { + // Generate a unique id - ensure that the value doesn't contain spaces. + // Without this id, checkbox/radio inputs can interfere with each other. + let value_no_spaces = value.clone().chars() + .filter(|c| !c.is_whitespace()) + .collect::(); + let id = format!("{}-{}", name.clone(), value_no_spaces); + view! { -