From 803e8575b3eebc8606d9794eec5fc59c0ef30c77 Mon Sep 17 00:00:00 2001 From: Mert Sincan Date: Sun, 12 Jan 2025 21:53:13 +0000 Subject: [PATCH] Fixed #7006 - @primevue/forms: Form components submit event parameter missing values --- packages/forms/src/useform/index.js | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/packages/forms/src/useform/index.js b/packages/forms/src/useform/index.js index b2b992aec..fb5d76d99 100644 --- a/packages/forms/src/useform/index.js +++ b/packages/forms/src/useform/index.js @@ -185,11 +185,9 @@ export const useForm = (options = {}) => { { names: [], values: {} } ); - let result = - (await options.resolver?.({ - names: resolverOptions.names, - values: groupKeys(resolverOptions.values) - })) ?? {}; + const [names, values] = [resolverOptions.names, groupKeys(resolverOptions.values)]; + + let result = (await options.resolver?.({ names, values })) ?? { values }; result.errors ??= {}; @@ -201,7 +199,7 @@ export const useForm = (options = {}) => { if (fieldResolver) { const fieldValue = fieldInst.states.value; - const fieldResult = (await fieldResolver({ values: fieldValue, value: fieldValue, name: fieldName })) ?? {}; + const fieldResult = (await fieldResolver({ values: fieldValue, value: fieldValue, name: fieldName })) ?? { values: fieldValue }; isArray(fieldResult.errors) && (fieldResult.errors = { [fieldName]: fieldResult.errors });