From 3e083e97e42ff99aec57ca32b7483ccc4bf62d88 Mon Sep 17 00:00:00 2001 From: melloware Date: Thu, 18 Aug 2022 10:13:24 -0400 Subject: [PATCH] Fix #3166: Dialog remove body hidden on blockScroll close --- components/lib/dialog/Dialog.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/components/lib/dialog/Dialog.js b/components/lib/dialog/Dialog.js index 1add80af44..124b3ec627 100644 --- a/components/lib/dialog/Dialog.js +++ b/components/lib/dialog/Dialog.js @@ -32,6 +32,9 @@ export const Dialog = React.forwardRef((props, ref) => { const [bindDocumentDragEndListener, unbindDocumentDragEndListener] = useEventListener({ type: 'mouseup', target: () => window.document, listener: (event) => onDragEnd(event) }); const onClose = (event) => { + if (props.blockScroll || (props.maximizable && maximized)) { + DomHandler.removeClass(document.body, 'p-overflow-hidden'); + } props.onHide(); event.preventDefault(); }