From 19ff3e8fc1d1a42753a095c173851a9627650596 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mehmet=20=C3=87etin?= <92744169+mehmetcetin01140@users.noreply.github.com> Date: Tue, 5 Mar 2024 12:45:10 +0300 Subject: [PATCH] refactor --- src/app/components/dialog/dialog.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/app/components/dialog/dialog.ts b/src/app/components/dialog/dialog.ts index 8f09103e94a..a6e3d72c717 100755 --- a/src/app/components/dialog/dialog.ts +++ b/src/app/components/dialog/dialog.ts @@ -626,9 +626,10 @@ export class Dialog implements AfterContentInit, OnInit, OnDestroy { this.unbindMaskClickListener(); } - const dialogElements = document.querySelectorAll('.p-dialog'); + // for nested dialogs w/modal + const scrollBlockers = document.querySelectorAll('.p-dialog-mask-scrollblocker'); - if (this.modal && !dialogElements) { + if (this.modal && scrollBlockers && scrollBlockers.length == 1) { DomHandler.unblockBodyScroll(); }