Skip to content
This repository was archived by the owner on Mar 25, 2025. It is now read-only.

Commit e383796

Browse files
boilundTigge
authored andcommitted
fix(menu): hover effect does not stay on menu button when menu is activated
1 parent c48baad commit e383796

File tree

2 files changed

+18
-9
lines changed

2 files changed

+18
-9
lines changed

packages/core/src/Menu/BaseMenu.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,8 @@ const MenuNativeButton = styled.button<{
8181
border: 2px solid transparent;
8282
}
8383
84-
&:hover {
84+
&:hover,
85+
&:focus-within {
8586
${MenuButtonIconContainer} {
8687
border: 0 solid transparent;
8788
}

packages/core/src/Menu/__snapshots__/index.test.tsx.snap

Lines changed: 16 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -127,11 +127,13 @@ exports[`Menus Menu (default) 1`] = `
127127
border: 2px solid transparent;
128128
}
129129
130-
.c3:hover .c4 {
130+
.c3:hover .c4,
131+
.c3:focus-within .c4 {
131132
border: 0 solid transparent;
132133
}
133134
134-
.c3:hover .c8 {
135+
.c3:hover .c8,
136+
.c3:focus-within .c8 {
135137
background-color: rgba(204,204,204,0.16);
136138
-webkit-transform: scale(1);
137139
-ms-transform: scale(1);
@@ -350,11 +352,13 @@ exports[`Menus Menu (disabled) 1`] = `
350352
border: 2px solid transparent;
351353
}
352354
353-
.c3:hover .c4 {
355+
.c3:hover .c4,
356+
.c3:focus-within .c4 {
354357
border: 0 solid transparent;
355358
}
356359
357-
.c3:hover .c8 {
360+
.c3:hover .c8,
361+
.c3:focus-within .c8 {
358362
background-color: rgba(204,204,204,0.16);
359363
-webkit-transform: scale(1);
360364
-ms-transform: scale(1);
@@ -569,11 +573,13 @@ exports[`Menus Menu (left) 1`] = `
569573
border: 2px solid transparent;
570574
}
571575
572-
.c3:hover .c4 {
576+
.c3:hover .c4,
577+
.c3:focus-within .c4 {
573578
border: 0 solid transparent;
574579
}
575580
576-
.c3:hover .c8 {
581+
.c3:hover .c8,
582+
.c3:focus-within .c8 {
577583
background-color: rgba(204,204,204,0.16);
578584
-webkit-transform: scale(1);
579585
-ms-transform: scale(1);
@@ -788,11 +794,13 @@ exports[`Menus Menu (right) 1`] = `
788794
border: 2px solid transparent;
789795
}
790796
791-
.c3:hover .c4 {
797+
.c3:hover .c4,
798+
.c3:focus-within .c4 {
792799
border: 0 solid transparent;
793800
}
794801
795-
.c3:hover .c8 {
802+
.c3:hover .c8,
803+
.c3:focus-within .c8 {
796804
background-color: rgba(204,204,204,0.16);
797805
-webkit-transform: scale(1);
798806
-ms-transform: scale(1);

0 commit comments

Comments
 (0)