diff --git a/assets/js/src/form_editor/blocks/add_custom_field/add_custom_field_form.jsx b/assets/js/src/form_editor/blocks/add_custom_field/add_custom_field_form.jsx index e72a955deb..b9e8aa5aa9 100644 --- a/assets/js/src/form_editor/blocks/add_custom_field/add_custom_field_form.jsx +++ b/assets/js/src/form_editor/blocks/add_custom_field/add_custom_field_form.jsx @@ -87,6 +87,7 @@ const AddCustomFieldForm = ({ dateSettings, onSubmit }) => { ); diff --git a/assets/js/src/form_editor/blocks/custom_text/custom_field_settings.jsx b/assets/js/src/form_editor/blocks/custom_text/custom_field_settings.jsx index c285b2e071..e6b5efc680 100644 --- a/assets/js/src/form_editor/blocks/custom_text/custom_field_settings.jsx +++ b/assets/js/src/form_editor/blocks/custom_text/custom_field_settings.jsx @@ -17,6 +17,7 @@ const CustomFieldSettings = ({ isDeleting, onCustomFieldDelete, onChange, + fieldType, }) => { const [localMandatory, setLocalMandatory] = useState(mandatory); const [localValidate, setLocalValidate] = useState(validate); @@ -33,7 +34,7 @@ const CustomFieldSettings = ({ if (onChange) { onChange(localData, hasUnsavedChanges); } - }, [localData, onChange, hasUnsavedChanges]); + }, [localData, onChange, hasUnsavedChanges, fieldType]); return ( <> @@ -94,10 +95,12 @@ CustomFieldSettings.propTypes = { isDeleting: PropTypes.bool, onCustomFieldDelete: PropTypes.func, onChange: PropTypes.func, + fieldType: PropTypes.string, }; CustomFieldSettings.defaultProps = { mandatory: false, + fieldType: '', isSaving: false, validate: '', isDeleting: false,