feat: prevent short-circuit evaluation for validation
This commit is contained in:
1 parent
f08fee1246
commit
e0b54b96f9
3 files changed
+37
-20
No files matched your search
@@ -115,12 +115,16 @@ pub fn ValidatedForm(
|
||||
.with(|list| {
|
||||
list.iter()
|
||||
// TODO all() short circuits on the first false
|
||||
.all(|v| {
|
||||
// Not sure how this will work reactively.
|
||||
let result = matches!(v.get().error().get(), ValidationState::Valid);
|
||||
.fold(true, |acc, v| {
|
||||
v.update(|validator| validator.form_requested_validation.set(true));
|
||||
result
|
||||
matches!(v.get().error().get(), ValidationState::Valid) && acc
|
||||
})
|
||||
// .all(|v| {
|
||||
// // Not sure how this will work reactively.
|
||||
// let result = matches!(v.get().error().get(), ValidationState::Valid);
|
||||
// v.update(|validator| validator.form_requested_validation.set(true));
|
||||
// result
|
||||
// })
|
||||
})
|
||||
});
|
||||
|
||||
|
||||
Reference in new issue
Block a user