diff --git a/src/components/dialogs/network-modifications/two-windings-transformer/modification/two-windings-transformer-modification-dialog.jsx b/src/components/dialogs/network-modifications/two-windings-transformer/modification/two-windings-transformer-modification-dialog.jsx index 9ce0ad792b..05d4cec599 100644 --- a/src/components/dialogs/network-modifications/two-windings-transformer/modification/two-windings-transformer-modification-dialog.jsx +++ b/src/components/dialogs/network-modifications/two-windings-transformer/modification/two-windings-transformer-modification-dialog.jsx @@ -686,9 +686,15 @@ const TwoWindingsTransformerModificationDialog = ({ regulationSide: getValues(`${RATIO_TAP_CHANGER}.${REGULATION_SIDE}`), targetV: getValues(`${RATIO_TAP_CHANGER}.${TARGET_V}`), targetDeadband: getValues(`${RATIO_TAP_CHANGER}.${TARGET_DEADBAND}`), - lowTapPosition: getValues(`${RATIO_TAP_CHANGER}.${LOW_TAP_POSITION}`), - highTapPosition: getValues(`${RATIO_TAP_CHANGER}.${HIGH_TAP_POSITION}`), - tapPosition: getValues(`${RATIO_TAP_CHANGER}.${TAP_POSITION}`), + lowTapPosition: + getValues(`${RATIO_TAP_CHANGER}.${LOW_TAP_POSITION}`) ?? + twt?.ratioTapChanger?.lowTapPosition, + highTapPosition: + getValues(`${RATIO_TAP_CHANGER}.${HIGH_TAP_POSITION}`) ?? + twt?.ratioTapChanger?.highTapPosition, + tapPosition: + getValues(`${RATIO_TAP_CHANGER}.${TAP_POSITION}`) ?? + twt?.ratioTapChanger?.tapPosition, steps: addSelectedFieldToRows(getRatioTapChangerSteps(twt)), equipmentId: getValues(`${RATIO_TAP_CHANGER}.${EQUIPMENT}.${ID}`), equipmentType: getValues(`${RATIO_TAP_CHANGER}.${EQUIPMENT}.${TYPE}`), diff --git a/src/components/dialogs/network-modifications/two-windings-transformer/tap-changer-pane/ratio-tap-changer-pane/ratio-tap-changer-pane-utils.js b/src/components/dialogs/network-modifications/two-windings-transformer/tap-changer-pane/ratio-tap-changer-pane/ratio-tap-changer-pane-utils.js index cf9f4b11b1..b53813ce74 100644 --- a/src/components/dialogs/network-modifications/two-windings-transformer/tap-changer-pane/ratio-tap-changer-pane/ratio-tap-changer-pane-utils.js +++ b/src/components/dialogs/network-modifications/two-windings-transformer/tap-changer-pane/ratio-tap-changer-pane/ratio-tap-changer-pane-utils.js @@ -135,21 +135,21 @@ const ratioTapChangerValidationSchema = (isModification, id) => ({ .number() .nullable() .when(ENABLED, { - is: (enabled) => enabled && !isModification, + is: (enabled) => enabled, then: (schema) => schema.required(), }), [HIGH_TAP_POSITION]: yup .number() .nullable() .when(ENABLED, { - is: (enabled) => enabled && !isModification, + is: (enabled) => enabled, then: (schema) => schema.required(), }), [TAP_POSITION]: yup .number() .nullable() .when(ENABLED, { - is: (enabled) => enabled && !isModification, + is: (enabled) => enabled, then: (schema) => schema .required()