From db527bc73a8f3c3962c863f250a23a0865a55889 Mon Sep 17 00:00:00 2001 From: lilyvc <45168453+lilyvc@users.noreply.github.com> Date: Wed, 26 Jun 2024 13:35:23 +0100 Subject: [PATCH] Fix Menu showing behind Drawer (#3639) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Fernanda Castillo ❤️ --- .changeset/twelve-pets-poke.md | 5 +++++ packages/core/src/__tests__/__e2e__/menu/Menu.cy.tsx | 3 +++ packages/core/src/menu/MenuPanel.css | 2 +- 3 files changed, 9 insertions(+), 1 deletion(-) create mode 100644 .changeset/twelve-pets-poke.md diff --git a/.changeset/twelve-pets-poke.md b/.changeset/twelve-pets-poke.md new file mode 100644 index 00000000000..1f60f5f8e8a --- /dev/null +++ b/.changeset/twelve-pets-poke.md @@ -0,0 +1,5 @@ +--- +"@salt-ds/core": patch +--- + +Fixed Menu showing behind Drawer (#3636). diff --git a/packages/core/src/__tests__/__e2e__/menu/Menu.cy.tsx b/packages/core/src/__tests__/__e2e__/menu/Menu.cy.tsx index 9cab3082edd..ae6ab38eecd 100644 --- a/packages/core/src/__tests__/__e2e__/menu/Menu.cy.tsx +++ b/packages/core/src/__tests__/__e2e__/menu/Menu.cy.tsx @@ -12,6 +12,9 @@ describe("Given a Menu", () => { cy.findByRole("menu").should("not.exist"); cy.findByRole("button", { name: "Open Menu" }).realClick(); cy.findByRole("menu").should("exist"); + // Regression - #3636 + cy.get(".saltMenuPanel").should("have.css", "z-index", "1500"); + cy.get("@openChangeSpy").should("have.been.calledWith", true); cy.findByRole("menuitem", { name: "Copy" }).realClick(); cy.on("window:alert", (str) => { diff --git a/packages/core/src/menu/MenuPanel.css b/packages/core/src/menu/MenuPanel.css index 06db9d20a6b..a5873cd9030 100644 --- a/packages/core/src/menu/MenuPanel.css +++ b/packages/core/src/menu/MenuPanel.css @@ -5,7 +5,7 @@ overflow-y: auto; min-width: 10em; position: relative; - z-index: var(--salt-zIndex-popout); + z-index: var(--salt-zIndex-flyover); box-shadow: var(--salt-overlayable-shadow-popout); box-sizing: border-box; }