From e62a94c05ae2ae8d7fd106bfa873fb0ac1c23930 Mon Sep 17 00:00:00 2001 From: deeshu <99004662+deEshu2002@users.noreply.github.com> Date: Mon, 17 Apr 2023 17:43:33 +0530 Subject: [PATCH] feat: hiding dialog using X button should remove class "overflow-hidden" (#1555) Hiding dialogs result in the body to stay frozen due to mounting behaviour of the dialog, but using 'X' button hides the dialog and won't let user scroll any further. Removing overflow behaviour during hiding procedure will improve User Experience. --- web/src/components/Dialog/BaseDialog.tsx | 1 + 1 file changed, 1 insertion(+) diff --git a/web/src/components/Dialog/BaseDialog.tsx b/web/src/components/Dialog/BaseDialog.tsx index c2f32f81..a8c95670 100644 --- a/web/src/components/Dialog/BaseDialog.tsx +++ b/web/src/components/Dialog/BaseDialog.tsx @@ -92,6 +92,7 @@ export function generateDialog( hide: () => { tempDiv.firstElementChild?.classList.remove("showup"); tempDiv.firstElementChild?.classList.add("showoff"); + document.body.classList.remove("overflow-hidden"); }, };