From f58ae7ad6b4c3fc5f958917ee263ed37f4fc75c6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mehmet=20=C3=87etin?= <92744169+mehmetcetin01140@users.noreply.github.com> Date: Mon, 4 Mar 2024 17:37:55 +0300 Subject: [PATCH] Fixed #14933 - Scroll bar for the base page reappears after closing a secondary modal despite one modal still being open --- src/app/components/dialog/dialog.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/app/components/dialog/dialog.ts b/src/app/components/dialog/dialog.ts index 72c8ece449f..8f09103e94a 100755 --- a/src/app/components/dialog/dialog.ts +++ b/src/app/components/dialog/dialog.ts @@ -626,7 +626,9 @@ export class Dialog implements AfterContentInit, OnInit, OnDestroy { this.unbindMaskClickListener(); } - if (this.modal) { + const dialogElements = document.querySelectorAll('.p-dialog'); + + if (this.modal && !dialogElements) { DomHandler.unblockBodyScroll(); }