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/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/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 + > = ({ return ( { + if (reason !== "backdropClick") { + onClose(); + } + }} aria-labelledby="child-modal-title" aria-describedby="child-modal-description" >