diff --git a/src/process/processOne.ts b/src/process/processOne.ts index 4ab91202..5448a612 100644 --- a/src/process/processOne.ts +++ b/src/process/processOne.ts @@ -1,6 +1,7 @@ import { get, set } from "lodash"; import { Component, ProcessorsContext, ProcessorType } from "types"; import { getComponentKey } from "utils/formUtil"; +import { resetEphermalState } from "utils"; export function dataValue(component: Component, row: any) { const key = getComponentKey(component); @@ -8,7 +9,7 @@ export function dataValue(component: Component, row: any) { } export async function processOne(context: ProcessorsContext) { - const { processors } = context; + const { processors, component } = context; // Create a getter for `value` that is always derived from the current data object if (typeof context.value === 'undefined') { Object.defineProperty(context, 'value', { @@ -21,6 +22,8 @@ export async function processOne(context: ProcessorsContext(context: ProcessorsContext(context: ProcessorsContext) { - const { processors } = context; + const { processors, component } = context; // Create a getter for `value` that is always derived from the current data object if (typeof context.value === 'undefined') { Object.defineProperty(context, 'value', { @@ -46,6 +49,8 @@ export function processOneSync(context: ProcessorsContext { const row = getContextualRowData(component, compPath, data); - resetEphermalState(component); if (fn(component, data, row, compPath, componentComponents, index, compParent) === true) { return true; } diff --git a/src/utils/formUtil/eachComponentDataAsync.ts b/src/utils/formUtil/eachComponentDataAsync.ts index 9fe434e0..d44a681a 100644 --- a/src/utils/formUtil/eachComponentDataAsync.ts +++ b/src/utils/formUtil/eachComponentDataAsync.ts @@ -36,8 +36,6 @@ export const eachComponentDataAsync = async ( components, async (component: any, compPath: string, componentComponents: any, compParent: any) => { const row = getContextualRowData(component, compPath, data); - // If the component has ephermal state, then we need to reset the ephermal state in case this is e.g. a data grid, in which each row needs to be validated independently - resetEphermalState(component); if (await fn(component, data, row, compPath, componentComponents, index, compParent) === true) { return true; }