diff --git a/ui-ngx/src/app/core/services/calculated-field-form.service.ts b/ui-ngx/src/app/core/services/calculated-field-form.service.ts index 1b9dddfd26..1bedbf99a7 100644 --- a/ui-ngx/src/app/core/services/calculated-field-form.service.ts +++ b/ui-ngx/src/app/core/services/calculated-field-form.service.ts @@ -71,7 +71,7 @@ export class CalculatedFieldFormService { takeUntilDestroyed(destroyRef) ).subscribe(([prevType, nextType]) => { const shouldCheck = isEditActive ? isEditActive() : true; - if (shouldCheck) { + if (shouldCheck && prevType !== nextType) { if (![CalculatedFieldType.SIMPLE, CalculatedFieldType.SCRIPT].includes(prevType) || ![CalculatedFieldType.SIMPLE, CalculatedFieldType.SCRIPT].includes(nextType)) { form.get('configuration').setValue({} as CalculatedFieldConfiguration, { emitEvent: false });