Describe the bug
If a Dialog is unmounted before its close animation finishes, the mdc-dialog-scroll-lock class is not removed from the body and the page can no longer be scrolled (unless something else removes the class later, like opening another dialog)
To Reproduce
Steps to reproduce the behavior:
- Open a dialog
- Navigate away from the current page before the dialog finishes closing (e.x. navigating back to the previous page in a SvelteKit app in CSR mode)
- You can no longer scroll even though there is no open dialog
Expected behavior
The mdc-dialog-scroll-lock class should be removed, even if the Dialog was unmounted before the close animation finished. Scroll lock state should be tied to the presence of an open dialog, not necessarily controlled by animation timings.
Screenshots
https://github.com/user-attachments/assets/04ede050-3770-45f7-a56c-c392608c72e6
Desktop (please complete the following information):
- OS: macOS 26.5
- Browser: Ungoogled Chromium
- Version: 148.0.7778.167 (Official Build, ungoogled-chromium) (arm64)
Additional context
Present since at least SMUI v7, still present in SMUI v9
Describe the bug
If a Dialog is unmounted before its close animation finishes, the mdc-dialog-scroll-lock class is not removed from the body and the page can no longer be scrolled (unless something else removes the class later, like opening another dialog)
To Reproduce
Steps to reproduce the behavior:
Expected behavior
The mdc-dialog-scroll-lock class should be removed, even if the Dialog was unmounted before the close animation finished. Scroll lock state should be tied to the presence of an open dialog, not necessarily controlled by animation timings.
Screenshots
https://github.com/user-attachments/assets/04ede050-3770-45f7-a56c-c392608c72e6
Desktop (please complete the following information):
Additional context
Present since at least SMUI v7, still present in SMUI v9