diff --git a/packages/conform-dom/form.ts b/packages/conform-dom/form.ts index 66717aa0..cb45fe05 100644 --- a/packages/conform-dom/form.ts +++ b/packages/conform-dom/form.ts @@ -332,6 +332,14 @@ function handleIntent( switch (intent.type) { case 'validate': { if (intent.payload.name) { + if (intent.payload.recursive) { + const allNames = Object.keys(meta.error).concat(fields ?? []); + for (const name of allNames) { + if (isPrefix(name, intent.payload.name)) { + meta.validated[name] = true; + } + } + } meta.validated[intent.payload.name] = true; } else { setFieldsValidated(meta, fields); diff --git a/packages/conform-dom/submission.ts b/packages/conform-dom/submission.ts index c13ec74b..21b28024 100644 --- a/packages/conform-dom/submission.ts +++ b/packages/conform-dom/submission.ts @@ -304,6 +304,7 @@ export type ValidateIntent = { type: 'validate'; payload: { name?: FieldName; + recursive?: boolean; }; };