Fix #478 - Add check for 'onFieldInitialize'

This commit is contained in:
Jack Anderson 2024-09-19 09:43:16 +01:00 committed by y.yerli
parent 7e73cdddcb
commit 464830fd9d

View file

@ -188,12 +188,18 @@ export class FieldLogicManager extends BaseActionManager<FieldLogicActionData> {
let actionTriggeringStatus = action?.triggeringStatus ?? frontendActionTriggeringStatus ?? defaultTriggeringStatus; let actionTriggeringStatus = action?.triggeringStatus ?? frontendActionTriggeringStatus ?? defaultTriggeringStatus;
if (triggeringStatus && !actionTriggeringStatus.includes(triggeringStatus)) { if (actionTriggeringStatus.includes('onValueChange')) {
actionTriggeringStatus = actionTriggeringStatus.filter(value => value !== 'onValueChange');
actionTriggeringStatus = ['onAnyLogic', ...actionTriggeringStatus];
}
if (actionTriggeringStatus.includes('onAnyLogic') && triggeringStatus !== 'onFieldInitialize') {
actions.push(action);
return; return;
} }
if (actionTriggeringStatus.includes('onValueChange')) { if (triggeringStatus && !actionTriggeringStatus.includes(triggeringStatus)) {
actionTriggeringStatus = ['onAnyLogic']; return;
} }
if (actionTriggeringStatus.includes('onDependencyChange') && !dependentFieldsKeys?.includes(fieldDependent.name)) { if (actionTriggeringStatus.includes('onDependencyChange') && !dependentFieldsKeys?.includes(fieldDependent.name)) {