From a01a5a83d7722d2beda9519e3e5abae4761d9996 Mon Sep 17 00:00:00 2001 From: Lucas Vas Date: Tue, 21 Oct 2025 17:24:52 -0400 Subject: [PATCH] fix: update id prop in Chip to be unique --- src/components/chips.rs | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) 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! { -