Fix Creating textarea custom field
[MAILPOET-2719]
This commit is contained in:
@@ -87,6 +87,7 @@ const AddCustomFieldForm = ({ dateSettings, onSubmit }) => {
|
|||||||
<TextFieldSettings
|
<TextFieldSettings
|
||||||
mandatory={fieldSettings.mandatory ? fieldSettings.mandatory : false}
|
mandatory={fieldSettings.mandatory ? fieldSettings.mandatory : false}
|
||||||
validate={fieldSettings.validate ? fieldSettings.validate : ''}
|
validate={fieldSettings.validate ? fieldSettings.validate : ''}
|
||||||
|
fieldType={fieldType}
|
||||||
onChange={setFieldSettings}
|
onChange={setFieldSettings}
|
||||||
/>
|
/>
|
||||||
);
|
);
|
||||||
|
@@ -17,6 +17,7 @@ const CustomFieldSettings = ({
|
|||||||
isDeleting,
|
isDeleting,
|
||||||
onCustomFieldDelete,
|
onCustomFieldDelete,
|
||||||
onChange,
|
onChange,
|
||||||
|
fieldType,
|
||||||
}) => {
|
}) => {
|
||||||
const [localMandatory, setLocalMandatory] = useState(mandatory);
|
const [localMandatory, setLocalMandatory] = useState(mandatory);
|
||||||
const [localValidate, setLocalValidate] = useState(validate);
|
const [localValidate, setLocalValidate] = useState(validate);
|
||||||
@@ -33,7 +34,7 @@ const CustomFieldSettings = ({
|
|||||||
if (onChange) {
|
if (onChange) {
|
||||||
onChange(localData, hasUnsavedChanges);
|
onChange(localData, hasUnsavedChanges);
|
||||||
}
|
}
|
||||||
}, [localData, onChange, hasUnsavedChanges]);
|
}, [localData, onChange, hasUnsavedChanges, fieldType]);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
@@ -94,10 +95,12 @@ CustomFieldSettings.propTypes = {
|
|||||||
isDeleting: PropTypes.bool,
|
isDeleting: PropTypes.bool,
|
||||||
onCustomFieldDelete: PropTypes.func,
|
onCustomFieldDelete: PropTypes.func,
|
||||||
onChange: PropTypes.func,
|
onChange: PropTypes.func,
|
||||||
|
fieldType: PropTypes.string,
|
||||||
};
|
};
|
||||||
|
|
||||||
CustomFieldSettings.defaultProps = {
|
CustomFieldSettings.defaultProps = {
|
||||||
mandatory: false,
|
mandatory: false,
|
||||||
|
fieldType: '',
|
||||||
isSaving: false,
|
isSaving: false,
|
||||||
validate: '',
|
validate: '',
|
||||||
isDeleting: false,
|
isDeleting: false,
|
||||||
|
Reference in New Issue
Block a user