From 1c698f27cbd92f1d2ab8d4a586611a2b2ce2a1d3 Mon Sep 17 00:00:00 2001 From: lcucuzzella Date: Tue, 3 Dec 2024 11:36:36 +0100 Subject: [PATCH] fix(U250): fix form ruolo disabilita salvataggio 20241203 --- fe-piattaforma/src/pages/forms/formUser.tsx | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/fe-piattaforma/src/pages/forms/formUser.tsx b/fe-piattaforma/src/pages/forms/formUser.tsx index c9e632924..4e640d0af 100644 --- a/fe-piattaforma/src/pages/forms/formUser.tsx +++ b/fe-piattaforma/src/pages/forms/formUser.tsx @@ -53,6 +53,7 @@ const FormUser: React.FC = (props) => { setIsFormValid = () => ({}), getFormValues = () => ({}), updateForm = () => ({}), + updateFormField = () => ({}), clearForm = () => ({}), creation = false, fieldsToHide = [], @@ -131,6 +132,9 @@ const FormUser: React.FC = (props) => { }, [userDetails, fieldsToHide.length, creation]); useEffect(() => { + if (fieldsToHide.includes('ruolo') && form?.ruolo?.value === '') { + updateFormField('ruolo', 'remove'); + } setIsFormValid(isValidForm); sendNewValues(getFormValues()); // eslint-disable-next-line react-hooks/exhaustive-deps