Skip to content

Commit

Permalink
FIO-8640: Fixes an issue where rowIndex is undefined in custom valida…
Browse files Browse the repository at this point in the history
…tion
  • Loading branch information
alexandraRamanenka committed Nov 20, 2024
1 parent 770d1df commit 2fc4bf6
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions src/process/validation/rules/validateCustom.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit 2fc4bf6

Please sign in to comment.