feat: prevent short-circuit evaluation for validation

This commit is contained in:
alphafetus committed 2026-01-05 15:20:04 -05:00
1 parent f08fee1246
commit e0b54b96f9
3 files changed
+37 -20

No files matched your search

+8 -4
View File
@@ -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
// })
})
});