fix: allow uniquely named lists to work with multientry component

This commit is contained in:
alphafetus committed 2026-02-04 22:01:44 -05:00
1 parent 4bf0cdcb39
commit 956c653e28
4 files changed
+31 -10

No files matched your search

+9 -1
View File
@@ -26,7 +26,14 @@ pub enum InputType {
}
impl InputType {
pub fn into_view(self, data_map: RwSignal<HashMap<String, ValueType>>) -> impl IntoView {
/// Converts an `InputType` into an `impl IntoView`. A name must be specified in the case that
/// the component is a checkbox/radio list, which requires a unique name to function properly.
/// Many times, the name will be the same as the data member.
pub fn into_view(
self,
data_map: RwSignal<HashMap<String, ValueType>>,
name: String,
) -> impl IntoView {
view! {
{match self {
InputType::Text(member, label, placeholder, required) =>
@@ -56,6 +63,7 @@ impl InputType {
view! {
<CheckboxList
label = label.clone()
name = name.clone()
items = options.clone()
data_member = member.clone()
data_map = data_map