Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(menu): ensure that the correct focus and hover styling is applied to popover-container button - FE-7061 #7194

Merged
merged 2 commits into from
Feb 10, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions src/components/menu/menu-item/menu-item.style.ts
Original file line number Diff line number Diff line change
Expand Up @@ -181,6 +181,11 @@ const StyledMenuItemWrapper = styled.a.attrs({

a:hover,
button:hover {
${StyledButton} {
border-radius: 0;
background-color: transparent;
}

${!asDiv &&
css`
background-color: var(--colorsComponentsMenuAutumnStandard600);
Expand Down
18 changes: 18 additions & 0 deletions src/components/menu/menu.pw.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2378,4 +2378,22 @@ test.describe("Styling, Scrolling & Navigation Bar Tests for Menu Component", ()
await expect(menuItemAnchor).toHaveCSS("height", "40px");
await expect(buttonChild).toHaveCSS("height", "40px");
});

test("should render the menu with the expected hover styling when menu item has a PopoverContainer child with renderOpenComponent passed", async ({
mount,
page,
}) => {
await mount(<MenuItemWithPopoverContainerChild />);

const popoverContainerButton = page.getByRole("button", {
name: "notification",
});
await popoverContainerButton.hover();

await expect(popoverContainerButton).toHaveCSS("border-radius", "0px");
await expect(popoverContainerButton).toHaveCSS(
"background-color",
"rgba(0, 0, 0, 0)",
);
});
});
Loading