fix: create cleanup handlers for lists
This commit is contained in:
1 parent
22d2c96520
commit
5f6e0edab2
3 files changed
+23
-5
No files matched your search
@@ -96,14 +96,20 @@ pub fn RadioList(
|
||||
dirty.get() && matches!(error.get(), ValidationState::Invalid(_))
|
||||
});
|
||||
|
||||
let input_state = InputState::new(
|
||||
let input_state = RwSignal::new(InputState::new(
|
||||
data_member.get_untracked(),
|
||||
error.clone(),
|
||||
dirty.clone()
|
||||
);
|
||||
));
|
||||
|
||||
validation_context.validators.update(|list| list.push(RwSignal::new(input_state)));
|
||||
validation_context.validators.update(|list| list.push(input_state));
|
||||
|
||||
on_cleanup(move || {
|
||||
validation_context.validators.update(|list| {
|
||||
list.retain(|v| *v.get_untracked().input_name != *input_state.get_untracked().input_name)
|
||||
});
|
||||
});
|
||||
|
||||
//#endregion
|
||||
//#region Render Logic
|
||||
|
||||
|
||||
Reference in new issue
Block a user