Fix profile modal stacking by hiding sidebar when active

Adds `modal-open` class to `body` and `documentElement` when the profile modal opens, and removes it when it closes. This activates the existing CSS rule that hides the sidebar and lowers its z-index, resolving the issue where the sidebar appeared on top of the modal on desktop.
This commit is contained in:
google-labs-jules[bot] committed 2026-01-20 02:50:30 +00:00
1 parent f4cff7313a
commit 3f4e4b00f9
1 file changed
+12
+12
View File
@@ -12363,6 +12363,12 @@ export class ProfileModalController {
modalRoot.classList.remove("hidden");
modalRoot.setAttribute("aria-hidden", "false");
if (document.body) {
document.body.classList.add("modal-open");
}
if (document.documentElement) {
document.documentElement.classList.add("modal-open");
}
this.setGlobalModalState("profile", true);
const preserveMenu = this.isMobileLayoutActive();
this.selectPane(pane, { keepMenuView: preserveMenu });
@@ -12396,6 +12402,12 @@ export class ProfileModalController {
modalElement.setAttribute("aria-hidden", "true");
delete modalElement.dataset.nestedModalActive;
delete modalElement.dataset.modalStack;
if (document.body) {
document.body.classList.remove("modal-open");
}
if (document.documentElement) {
document.documentElement.classList.remove("modal-open");
}
this.setGlobalModalState("profile", false);
this.setMobileView("menu", { skipFocusTrap: true });