Skip to content

Commit

Permalink
fix(menu): hover effect does not stay on menu button when menu is act…
Browse files Browse the repository at this point in the history
…ivated
  • Loading branch information
boilund authored and Tigge committed Dec 8, 2021
1 parent c48baad commit e383796
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 9 deletions.
3 changes: 2 additions & 1 deletion packages/core/src/Menu/BaseMenu.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,8 @@ const MenuNativeButton = styled.button<{
border: 2px solid transparent;
}
&:hover {
&:hover,
&:focus-within {
${MenuButtonIconContainer} {
border: 0 solid transparent;
}
Expand Down
24 changes: 16 additions & 8 deletions packages/core/src/Menu/__snapshots__/index.test.tsx.snap
Original file line number Diff line number Diff line change
Expand Up @@ -127,11 +127,13 @@ exports[`Menus Menu (default) 1`] = `
border: 2px solid transparent;
}
.c3:hover .c4 {
.c3:hover .c4,
.c3:focus-within .c4 {
border: 0 solid transparent;
}
.c3:hover .c8 {
.c3:hover .c8,
.c3:focus-within .c8 {
background-color: rgba(204,204,204,0.16);
-webkit-transform: scale(1);
-ms-transform: scale(1);
Expand Down Expand Up @@ -350,11 +352,13 @@ exports[`Menus Menu (disabled) 1`] = `
border: 2px solid transparent;
}
.c3:hover .c4 {
.c3:hover .c4,
.c3:focus-within .c4 {
border: 0 solid transparent;
}
.c3:hover .c8 {
.c3:hover .c8,
.c3:focus-within .c8 {
background-color: rgba(204,204,204,0.16);
-webkit-transform: scale(1);
-ms-transform: scale(1);
Expand Down Expand Up @@ -569,11 +573,13 @@ exports[`Menus Menu (left) 1`] = `
border: 2px solid transparent;
}
.c3:hover .c4 {
.c3:hover .c4,
.c3:focus-within .c4 {
border: 0 solid transparent;
}
.c3:hover .c8 {
.c3:hover .c8,
.c3:focus-within .c8 {
background-color: rgba(204,204,204,0.16);
-webkit-transform: scale(1);
-ms-transform: scale(1);
Expand Down Expand Up @@ -788,11 +794,13 @@ exports[`Menus Menu (right) 1`] = `
border: 2px solid transparent;
}
.c3:hover .c4 {
.c3:hover .c4,
.c3:focus-within .c4 {
border: 0 solid transparent;
}
.c3:hover .c8 {
.c3:hover .c8,
.c3:focus-within .c8 {
background-color: rgba(204,204,204,0.16);
-webkit-transform: scale(1);
-ms-transform: scale(1);
Expand Down

0 comments on commit e383796

Please sign in to comment.