fix: allow uniquely named lists to work with multientry component
This commit is contained in:
1 parent
4bf0cdcb39
commit
956c653e28
4 files changed
+31
-10
No files matched your search
@@ -103,6 +103,10 @@ pub fn Checkbox(
|
||||
/// ```
|
||||
#[component]
|
||||
pub fn CheckboxList(
|
||||
/// The name that this list should use. This doesn't need to be specified all the time, but is
|
||||
/// for use in elements that may treat this list as a sub-input (components like the [`MultiEntry`]
|
||||
/// do this)
|
||||
#[prop(optional, into)] name: Signal<String>,
|
||||
/// The data member that this list should edit/display from the `data_map`.
|
||||
#[prop(into)] data_member: Signal<String>,
|
||||
/// A [`Signal`] allowing access to a data store.
|
||||
@@ -160,7 +164,7 @@ pub fn CheckboxList(
|
||||
on_change=on_change
|
||||
// The actual selected values are tracked by this element, not by the checkboxes themselves.
|
||||
value=item
|
||||
name=data_member
|
||||
name=move || format!("{}_{}", name.get(), data_member.get())
|
||||
disabled=disabled
|
||||
/>
|
||||
}
|
||||
|
||||
@@ -151,6 +151,7 @@ pub fn RadioList(
|
||||
#[prop(optional, into)] label: String,
|
||||
#[prop(optional, into)] required: Signal<bool>,
|
||||
#[prop(optional, into)] other_prompt: Signal<String>,
|
||||
#[prop(optional, into)] name: Signal<String>
|
||||
) -> impl IntoView {
|
||||
//#region Value Logic
|
||||
|
||||
@@ -262,7 +263,7 @@ pub fn RadioList(
|
||||
on_change=on_change
|
||||
// The actual selected values are tracked by this element, not by the checkboxes themselves.
|
||||
value=item
|
||||
name=data_member
|
||||
name=move || format!("{}_{}", name.get(), data_member.get())
|
||||
disabled=disabled
|
||||
/>
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user