From eb367b86f4919e0a9c23b02bda0233573adb04ae Mon Sep 17 00:00:00 2001 From: Nilotpal Saha Date: Mon, 4 Nov 2024 23:04:49 +0530 Subject: [PATCH] +autocomplete off in input fields --- package/components/inputs/forms/CoreEditForm.js | 1 + package/components/inputs/forms/CoreFormInputs.js | 2 +- package/utils/formUtils.js | 13 ++++++++++--- 3 files changed, 12 insertions(+), 4 deletions(-) diff --git a/package/components/inputs/forms/CoreEditForm.js b/package/components/inputs/forms/CoreEditForm.js index efe823d8..9ce7c963 100644 --- a/package/components/inputs/forms/CoreEditForm.js +++ b/package/components/inputs/forms/CoreEditForm.js @@ -51,6 +51,7 @@ export default function CoreEditForm(props) { enableReinitialize={true} initialValues={Array.isArray(formData) ? formData[index] : formData} validationSchema={forms[formId]?.formValidationOb} + // validateOnMount={true} // need to check onSubmit={props.handleSubmit} innerRef={formRef} > diff --git a/package/components/inputs/forms/CoreFormInputs.js b/package/components/inputs/forms/CoreFormInputs.js index 13a5e4cf..3dc34feb 100644 --- a/package/components/inputs/forms/CoreFormInputs.js +++ b/package/components/inputs/forms/CoreFormInputs.js @@ -35,7 +35,7 @@ export default function CoreFormInputs(props) { handleButtonCLick, submitLoading, OnCancelClick, - mode, + mode } = props; const { config } = React.useContext(WrappidDataContext); diff --git a/package/utils/formUtils.js b/package/utils/formUtils.js index 2415ed75..a5380b0c 100644 --- a/package/utils/formUtils.js +++ b/package/utils/formUtils.js @@ -311,7 +311,7 @@ export function createFormFieldProps(props, type) { OnEditClick, editFormId, allowEdit, - onFormFocus, + onFormFocus } = props; if (type === "edit") { @@ -323,8 +323,8 @@ export function createFormFieldProps(props, type) { styleClasses: element?.styleClasses, ...(initProps[element?.id] || {}), }; - } else - return { + } else { + let _props = { OnEditClick : OnEditClick, allowEdit : allowEdit, asyncLoading: element?.asyncLoading, @@ -441,6 +441,13 @@ export function createFormFieldProps(props, type) { value : formikprops?.values ? formikprops?.values[element?.id] : "", ...(initProps[element?.id] || {}), }; + + if (element?.autoComplete) { + _props.autoComplete = element?.autoComplete; + _props.inputProps.autoComplete = element?.autoComplete; + } + return _props; + } } else { return { id : element?.id ? String(element?.id) : "",