Skip to content

Commit 4dd6bef

Browse files
authored
ActionList: Fix leaky disabled description styles (#4566)
* replace leaky & with data-component * Create stupid-stingrays-sparkle.md
1 parent 4ecbe1a commit 4dd6bef

File tree

2 files changed

+10
-12
lines changed

2 files changed

+10
-12
lines changed
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@primer/react": patch
3+
---
4+
5+
ActionList: Fix leaky description styles for disabled item

packages/react/src/ActionList/Description.tsx

Lines changed: 5 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -28,23 +28,15 @@ export const Description: React.FC<React.PropsWithChildren<ActionListDescription
2828
minWidth: 0,
2929
marginLeft: variant === 'block' ? 0 : 2,
3030
color: 'fg.muted',
31-
'li[aria-disabled="true"] &': {
32-
color: 'inherit',
33-
},
34-
'li[data-variant="danger"]:hover &, li[data-variant="danger"]:active &': {
35-
color: 'inherit',
36-
},
31+
'li[aria-disabled="true"] &[data-component="ActionList.Description"]': {color: 'inherit'},
32+
'li[data-variant="danger"]:hover &[data-component="ActionList.Description"], li[data-variant="danger"]:active &[data-component="ActionList.Description"]':
33+
{color: 'inherit'},
3734
}
3835

3936
const {blockDescriptionId, inlineDescriptionId} = React.useContext(ItemContext)
4037

4138
return variant === 'block' ? (
42-
<Box
43-
as="span"
44-
// huh why?
45-
sx={merge(styles, sx as SxProp)}
46-
id={blockDescriptionId}
47-
>
39+
<Box as="span" sx={merge(styles, sx as SxProp)} id={blockDescriptionId} data-component="ActionList.Description">
4840
{props.children}
4941
</Box>
5042
) : (
@@ -54,6 +46,7 @@ export const Description: React.FC<React.PropsWithChildren<ActionListDescription
5446
title={props.children as string}
5547
inline={true}
5648
maxWidth="100%"
49+
data-component="ActionList.Description"
5750
>
5851
{props.children}
5952
</Truncate>

0 commit comments

Comments
 (0)