Dialog modal unlocks body scroll while another modal dialog is still open

Hello,

We found an issue with ejs-dialog when working with multiple modal dialogs.

When closing one modal dialog, the component removes the global body classes (e-dlg-target and e-scroll-disabled) even if another modal dialog is still open. This causes the body scroll to be unlocked prematurely, resulting in the scrollbar appearing while a modal dialog is still active and leading to layout issues.

How to reproduce:

  1. Open the StackBlitz demo: https://stackblitz.com/edit/angular-moelhye1?file=src%2Fapp.component.html
  2. Click Open Dialog to open the first (parent) modal dialog.
  3. Click Next to open the second (child) modal dialog.
  4. Click Close on the second dialog.


Expected behavior:
The body scroll should remain locked because the first modal dialog is still open.

Actual behavior:
The body scroll is unlocked even though another modal dialog remains open.


Additional notes:

  • The issue appears to occur because the dialog close logic removes the body scroll lock unconditionally during hide(), without checking if other modal dialogs are still active.
  • This behavior is especially noticeable with nested dialogs or multiple modals opened in sequence.
  • A reference count (or similar mechanism) for open modal dialogs would prevent this issue.
  • We implemented a workaround locally, but this appears to be a framework-level behavior.


Best regards,
Wendell Gasparoni


3 Replies

MR Mallesh Ravi Chandran Syncfusion Team February 3, 2026 05:55 PM UTC

We have identified the reported issue "Dialog hides unlock body scroll while another dialog is still open" as a bug on our side. The fix will be included in our upcoming weekly patch release, scheduled for rolled out on or before the end of the week in February 2026.
 
The feedback regarding the reported issue will be provided by 04 February 2026.

Disclaimer: “Inclusion of this solution in the weekly release may change due to other factors including but not limited to QA checks and works reprioritization.”



MR Mallesh Ravi Chandran Syncfusion Team February 4, 2026 11:14 AM UTC

As per the previous update , we have identified the reported issue "Dialog hides unlock body scroll while another dialog is still open" as a bug on our side. The fix will be included in our upcoming weekly patch release, scheduled for rolled out on or before the end of the week in February 2026.
 

Now you can track the status of the reported issue through the feedback below,

https://www.syncfusion.com/feedback/72547/dialog-hides-unlock-body-scroll-while-another-dialog-is-still-open


Disclaimer: “Inclusion of this solution in the weekly release may change due to other factors including but not limited to QA checks and works reprioritization.”


MR Mallesh Ravi Chandran Syncfusion Team March 5, 2026 06:17 AM UTC

We have included the fix for the issue " Dialog hides unlock body scroll while another dialog is still open" with our release version 32.2.5v . So please upgrade your package to the latest to resolve the issue from your end.



Release Notes :

Root Cause : 
Previously, the dialog close logic removed the e-dlg-target and e-scroll-disabled classes unconditionally when a modal was closed, without considering other open modals.

Now, it tracks the count of open modals per container (using data attributes or DOM count) and removes these classes only when the count reaches zero.


Loader.
Up arrow icon