-
Notifications
You must be signed in to change notification settings - Fork 646
AvatarStack: Prevent border styles from applying to non-avatar components #7259
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
base: main
Are you sure you want to change the base?
Changes from all commits
df3687b
188dccd
740513a
abcf72a
6c8f33b
acd6118
66fc6cf
30768a1
0a98007
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| --- | ||
| '@primer/react': patch | ||
| --- | ||
|
|
||
| AvatarStack: Border was incorrectly applying to elements that were not `Avatar` children. |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| --- | ||
| '@primer/react': patch | ||
| --- | ||
|
|
||
| AvatarStack: The square prop was not applying to individual `Avatar` components. |
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -13,7 +13,7 @@ const transformChildren = (children: React.ReactNode, shape: AvatarStackProps['s | |||||
| if (!React.isValidElement(child)) return child | ||||||
| return React.cloneElement(child, { | ||||||
| ...child.props, | ||||||
| square: shape === 'square' ? true : undefined, | ||||||
| square: (shape === 'square' ? true : undefined) || child.props.square, | ||||||
|
||||||
| square: (shape === 'square' ? true : undefined) || child.props.square, | |
| square: shape === 'square' ? true : child.props.square, |
Copilot
AI
Dec 3, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Consider adding unit tests to verify the square prop behavior that this PR fixes. For example:
- Test that
shape="square"appliessquare={true}to Avatar children - Test that individual Avatar's
squareprop is respected when stack shape is 'circle' - Test that non-Avatar children don't receive the square prop
This would prevent regression of the bugs this PR fixes.
Uh oh!
There was an error while loading. Please reload this page.