Skip to content

Commit 58e3caf

Browse files
authored
fix(aci): fix automation builder hover states (#96489)
updated automation builder delete buttons to only be hidden if the device supports hover + use `visuallyHidden` instead of opacity
1 parent 35a3319 commit 58e3caf

File tree

2 files changed

+14
-12
lines changed

2 files changed

+14
-12
lines changed

static/app/views/automations/components/automationBuilder.tsx

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -254,17 +254,18 @@ const IfThenWrapper = styled(Flex)`
254254
padding: ${p => p.theme.space.lg};
255255
margin-top: ${p => p.theme.space.md};
256256
257-
.delete-condition-group {
258-
opacity: 0;
259-
}
260-
:hover .delete-condition-group {
261-
opacity: 1;
257+
/* Only hide delete button when hover is supported */
258+
@media (hover: hover) {
259+
&:not(:hover):not(:focus-within) {
260+
.delete-condition-group {
261+
${p => p.theme.visuallyHidden}
262+
}
263+
}
262264
}
263265
`;
264266

265267
const DeleteButton = styled(Button)`
266268
position: absolute;
267269
top: ${p => p.theme.space.sm};
268270
right: ${p => p.theme.space.sm};
269-
opacity: 0;
270271
`;

static/app/views/automations/components/automationBuilderRow.tsx

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -50,17 +50,18 @@ const RowContainer = styled('div')<{incompatible?: boolean}>`
5050
min-height: 46px;
5151
align-items: center;
5252
53-
.delete-row {
54-
opacity: 0;
55-
}
56-
:hover .delete-row {
57-
opacity: 1;
53+
/* Only hide delete button when hover is supported */
54+
@media (hover: hover) {
55+
&:not(:hover):not(:focus-within) {
56+
.delete-row {
57+
${p => p.theme.visuallyHidden}
58+
}
59+
}
5860
}
5961
`;
6062

6163
const DeleteButton = styled(Button)`
6264
position: absolute;
6365
top: ${space(0.75)};
6466
right: ${space(0.75)};
65-
opacity: 0;
6667
`;

0 commit comments

Comments
 (0)