Skip to content

Commit

Permalink
Bug fix: ButtonGroup borders (#3198)
Browse files Browse the repository at this point in the history
* fix hover borders

* Create wicked-knives-sparkle.md

* snaps

* why so many snaps?

* revert?

* test(vrt): update snapshots

---------

Co-authored-by: langermank <langermank@users.noreply.github.com>
  • Loading branch information
langermank and langermank authored Apr 20, 2023
1 parent 14c00e7 commit a273748
Show file tree
Hide file tree
Showing 12 changed files with 11 additions and 18 deletions.
5 changes: 5 additions & 0 deletions .changeset/wicked-knives-sparkle.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@primer/react": patch
---

Bug fix: `ButtonGroup` borders show incorrectly on hover
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
12 changes: 3 additions & 9 deletions src/ButtonGroup/ButtonGroup.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,29 +9,23 @@ const ButtonGroup = styled.div`
isolation: isolate;
&& > * {
margin-inline-end: -1px;
position: relative;
border-right-width: 0;
border-radius: 0;
:first-child {
border-top-left-radius: ${get('radii.2')};
border-bottom-left-radius: ${get('radii.2')};
margin-right: 0;
}
:not(:first-child) {
margin-left: 0;
margin-right: 0;
}
:last-child {
border-right-width: 1px;
border-top-right-radius: ${get('radii.2')};
border-bottom-right-radius: ${get('radii.2')};
}
:focus,
:active {
:active,
:hover {
z-index: 1;
}
}
Expand Down
12 changes: 3 additions & 9 deletions src/__tests__/deprecated/__snapshots__/Button.test.tsx.snap
Original file line number Diff line number Diff line change
Expand Up @@ -293,30 +293,24 @@ exports[`ButtonGroup renders consistently 1`] = `
}
.c0.c0 > * {
margin-inline-end: -1px;
position: relative;
border-right-width: 0;
border-radius: 0;
}
.c0.c0 > *:first-child {
border-top-left-radius: 6px;
border-bottom-left-radius: 6px;
margin-right: 0;
}
.c0.c0 > *:not(:first-child) {
margin-left: 0;
margin-right: 0;
}
.c0.c0 > *:last-child {
border-right-width: 1px;
border-top-right-radius: 6px;
border-bottom-right-radius: 6px;
}
.c0.c0 > *:focus,
.c0.c0 > *:active {
.c0.c0 > *:active,
.c0.c0 > *:hover {
z-index: 1;
}
Expand Down

0 comments on commit a273748

Please sign in to comment.