Skip to content

Commit

Permalink
Fix #3166: Dialog remove body hidden on blockScroll close
Browse files Browse the repository at this point in the history
  • Loading branch information
melloware committed Aug 18, 2022
1 parent 32d3b49 commit 3e083e9
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions components/lib/dialog/Dialog.js
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}
Expand Down

0 comments on commit 3e083e9

Please sign in to comment.