From c9a746616e1f6066f7a6990baa0badbd765ddd4c Mon Sep 17 00:00:00 2001 From: Arif-tekdi-technologies Date: Thu, 21 Nov 2024 15:38:35 +0530 Subject: [PATCH 1/2] Issue #0000 feat: Modal bug fixes --- src/components/ConfirmationModal.tsx | 6 +++++- src/components/SimpleModal.tsx | 6 +++++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/src/components/ConfirmationModal.tsx b/src/components/ConfirmationModal.tsx index 72e14464..44c8c466 100644 --- a/src/components/ConfirmationModal.tsx +++ b/src/components/ConfirmationModal.tsx @@ -46,7 +46,11 @@ const ConfirmationModal: React.FC = ({ return ( { + if (reason !== "backdropClick") { + handleCloseModal(); + } + }} aria-labelledby="confirmation-modal-title" aria-describedby="confirmation-modal-description" > diff --git a/src/components/SimpleModal.tsx b/src/components/SimpleModal.tsx index ea2d188c..fd743b2a 100644 --- a/src/components/SimpleModal.tsx +++ b/src/components/SimpleModal.tsx @@ -78,7 +78,11 @@ const SimpleModal: React.FC = ({ return ( { + if (reason !== "backdropClick") { + onClose(); + } + }} aria-labelledby="child-modal-title" aria-describedby="child-modal-description" > From 57959107a27b03beda1367351741b0a72f88c227 Mon Sep 17 00:00:00 2001 From: Arif-tekdi-technologies Date: Thu, 21 Nov 2024 15:46:52 +0530 Subject: [PATCH 2/2] Issue #0000 feat: Modal bug fixes 2 --- src/components/AddBlockModal.tsx | 10 ++++++++-- src/components/AddDistrictModal.tsx | 9 ++++++++- src/components/AddStateModal.tsx | 11 +++++++++-- src/components/FileUploadDialog.tsx | 11 ++++++++++- 4 files changed, 35 insertions(+), 6 deletions(-) diff --git a/src/components/AddBlockModal.tsx b/src/components/AddBlockModal.tsx index b2f76de9..fd3af937 100644 --- a/src/components/AddBlockModal.tsx +++ b/src/components/AddBlockModal.tsx @@ -116,7 +116,6 @@ export const AddBlockModal: React.FC = ({ const districtCodeArray = districts.map((item: any) => item.value); setDistrictCodeArr(districtCodeArray); - } catch (error) { console.error("Error fetching districts", error); } @@ -296,7 +295,14 @@ export const AddBlockModal: React.FC = ({ : t("COMMON.ADD_BLOCK"); return ( - + { + if (reason !== "backdropClick") { + onClose(); + } + }} + > {dialogTitle} diff --git a/src/components/AddDistrictModal.tsx b/src/components/AddDistrictModal.tsx index 1dc903a7..5436d1e3 100644 --- a/src/components/AddDistrictModal.tsx +++ b/src/components/AddDistrictModal.tsx @@ -163,7 +163,14 @@ const AddDistrictModal: React.FC = ({ : t("COMMON.ADD_DISTRICT"); return ( - + { + if (reason !== "backdropClick") { + onClose(); + } + }} + > {dialogTitle} diff --git a/src/components/AddStateModal.tsx b/src/components/AddStateModal.tsx index 124991ab..6672a26f 100644 --- a/src/components/AddStateModal.tsx +++ b/src/components/AddStateModal.tsx @@ -94,7 +94,7 @@ export const AddStateModal: React.FC = ({ newErrors.name = t("COMMON.STATE_NAME_REQUIRED"); } else if (!isValidName(formData.name.trim())) { newErrors.name = t("COMMON.INVALID_TEXT"); - } + } if (!formData.value) { newErrors.value = t("COMMON.CODE_REQUIRED"); @@ -113,7 +113,14 @@ export const AddStateModal: React.FC = ({ }; return ( - + { + if (reason !== "backdropClick") { + onClose(); + } + }} + > {stateId ? t("COMMON.UPDATE_STATE") : t("COMMON.ADD_STATE")} diff --git a/src/components/FileUploadDialog.tsx b/src/components/FileUploadDialog.tsx index e30bbf57..33d294c1 100644 --- a/src/components/FileUploadDialog.tsx +++ b/src/components/FileUploadDialog.tsx @@ -33,7 +33,16 @@ const FileUploadDialog: React.FC = ({ return ( - + { + if (reason !== "backdropClick") { + onClose(); + } + }} + maxWidth="lg" + fullWidth + >