From 2fc4bf6f759abedff4c13fc8a3fd5ffba2996c2b Mon Sep 17 00:00:00 2001 From: Aliaksandra Ramanenka Date: Wed, 20 Nov 2024 15:25:34 +0200 Subject: [PATCH] FIO-8640: Fixes an issue where rowIndex is undefined in custom validation --- src/process/validation/rules/validateCustom.ts | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/src/process/validation/rules/validateCustom.ts b/src/process/validation/rules/validateCustom.ts index 960b150a..d48866cd 100644 --- a/src/process/validation/rules/validateCustom.ts +++ b/src/process/validation/rules/validateCustom.ts @@ -23,16 +23,17 @@ export const validateCustomSync: RuleFnSync = (context: ValidationContext) => { return null; } + const ctx = instance?.evalContext + ? instance.evalContext() + : evalContext + ? evalContext(context) + : context; const evalContextValue = { - ...(instance?.evalContext - ? instance.evalContext() - : evalContext - ? evalContext(context) - : context), + ...ctx, component, data, row, - rowIndex: index, + rowIndex: typeof index === 'number' ? index : ctx.rowIndex, instance, valid: true, input: value,