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'); } };