From da248079420359fb12b5647620b94cc604b3cb39 Mon Sep 17 00:00:00 2001 From: melloware Date: Thu, 25 Aug 2022 14:08:40 -0400 Subject: [PATCH] Fix #3166: Dialog remove blockScroll on exit --- components/lib/dialog/Dialog.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/components/lib/dialog/Dialog.js b/components/lib/dialog/Dialog.js index bc3cf20f9c..f37d82b8b9 100644 --- a/components/lib/dialog/Dialog.js +++ b/components/lib/dialog/Dialog.js @@ -32,7 +32,6 @@ export const Dialog = React.forwardRef((props, ref) => { const [bindDocumentDragEndListener, unbindDocumentDragEndListener] = useEventListener({ type: 'mouseup', target: () => window.document, listener: (event) => onDragEnd(event) }); const onClose = (event) => { - DomHandler.removeClass(document.body, 'p-overflow-hidden'); props.onHide(); event.preventDefault(); }; @@ -260,6 +259,7 @@ export const Dialog = React.forwardRef((props, ref) => { const onExiting = () => { if (props.modal) { DomHandler.addClass(maskRef.current, 'p-component-overlay-leave'); + DomHandler.removeClass(document.body, 'p-overflow-hidden'); } };