From 728375158de6d5080a245a3113c6934a2a4534c2 Mon Sep 17 00:00:00 2001 From: Glauber Silva Date: Wed, 23 Aug 2023 15:00:20 -0300 Subject: [PATCH] fix: set correct value to isNewField const --- .../src/supports/field-settings/FieldSettingsHOC.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/FormBuilder/resources/js/form-builder/src/supports/field-settings/FieldSettingsHOC.tsx b/src/FormBuilder/resources/js/form-builder/src/supports/field-settings/FieldSettingsHOC.tsx index 3f683c6ef3..18b5d0ff60 100644 --- a/src/FormBuilder/resources/js/form-builder/src/supports/field-settings/FieldSettingsHOC.tsx +++ b/src/FormBuilder/resources/js/form-builder/src/supports/field-settings/FieldSettingsHOC.tsx @@ -61,7 +61,7 @@ const generateEmailTag = (fieldName, storeAsDonorMeta) => { function FieldSettingsEdit({attributes, setAttributes, fieldSettings}) { const validateFieldName = useFieldNameValidator(); const [hasFieldNameAttribute, setHasFieldNameAttribute] = useState(attributes.hasOwnProperty('fieldName')); - const [isNewField] = useState(hasFieldNameAttribute); + const [isNewField] = useState(!hasFieldNameAttribute); const updateFieldName = useCallback( (newFieldName = null, bumpUniqueness = false) => {