From aaf907c834343970e1d30b3ef49c13ed5f9d34ed Mon Sep 17 00:00:00 2001
From: it-fixcomart <it@fixcomart.co.id>
Date: Tue, 17 Sep 2024 09:01:04 +0700
Subject: <iman> add focus error when button submit click

---
 src-migrate/modules/register/components/FormBisnis.tsx | 11 +++++++++--
 1 file changed, 9 insertions(+), 2 deletions(-)

(limited to 'src-migrate/modules/register/components/FormBisnis.tsx')

diff --git a/src-migrate/modules/register/components/FormBisnis.tsx b/src-migrate/modules/register/components/FormBisnis.tsx
index dd9cd72f..2ac998c9 100644
--- a/src-migrate/modules/register/components/FormBisnis.tsx
+++ b/src-migrate/modules/register/components/FormBisnis.tsx
@@ -26,6 +26,7 @@ interface FormProps {
   required: boolean;
   isPKP: boolean;
   chekValid: boolean;
+  buttonSubmitClick: boolean;
 }
 
 interface industry_id {
@@ -39,7 +40,13 @@ interface companyType {
   label: string;
 }
 
-const form: React.FC<FormProps> = ({ type, required, isPKP, chekValid }) => {
+const form: React.FC<FormProps> = ({
+  type,
+  required,
+  isPKP,
+  chekValid,
+  buttonSubmitClick,
+}) => {
   const { form, errors, updateForm, validate } = useRegisterStore();
   const { control, watch, setValue } = useForm();
   const [selectedCategory, setSelectedCategory] = useState<string>('');
@@ -278,7 +285,7 @@ const form: React.FC<FormProps> = ({ type, required, isPKP, chekValid }) => {
       }
     };
     loadIndustries();
-  }, [chekValid, form, errors]);
+  }, [buttonSubmitClick]);
 
   const handleSubmit = async (e: ChangeEvent<HTMLFormElement>) => {
     e.preventDefault();
-- 
cgit v1.2.3

