Skip to content

Commit c66b808

Browse files
pksjcedependabot[bot]owenniblockjoshblacklangermank
authored
Tentative focus fix in action list item (#4166)
* Tentative focus fix in action list item * Update snapshots * Create purple-bees-warn.md * chore(deps-dev): bump @babel/cli from 7.22.10 to 7.23.9 (#4189) Bumps [@babel/cli](https://github.com/babel/babel/tree/HEAD/packages/babel-cli) from 7.22.10 to 7.23.9. - [Release notes](https://github.com/babel/babel/releases) - [Changelog](https://github.com/babel/babel/blob/main/CHANGELOG.md) - [Commits](https://github.com/babel/babel/commits/v7.23.9/packages/babel-cli) --- updated-dependencies: - dependency-name: "@babel/cli" dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * chore(deps-dev): bump terser from 5.17.6 to 5.27.0 (#4187) Bumps [terser](https://github.com/terser/terser) from 5.17.6 to 5.27.0. - [Changelog](https://github.com/terser/terser/blob/master/CHANGELOG.md) - [Commits](terser/terser@v5.17.6...v5.27.0) --- updated-dependencies: - dependency-name: terser dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * chore(deps-dev): bump @storybook/source-loader from 7.6.7 to 7.6.10 (#4186) Bumps [@storybook/source-loader](https://github.com/storybookjs/storybook/tree/HEAD/code/lib/source-loader) from 7.6.7 to 7.6.10. - [Release notes](https://github.com/storybookjs/storybook/releases) - [Changelog](https://github.com/storybookjs/storybook/blob/next/CHANGELOG.md) - [Commits](https://github.com/storybookjs/storybook/commits/v7.6.10/code/lib/source-loader) --- updated-dependencies: - dependency-name: "@storybook/source-loader" dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Improve aria-labels for example icon buttons and add guidance (#4191) * Improve aria-labels for example icon buttons and add guidance * test(vrt): update snapshots --------- Co-authored-by: joshblack <[email protected]> * chore(deps): bump @github/combobox-nav from 2.1.7 to 2.3.1 (#4185) * chore(deps): bump @github/combobox-nav from 2.1.7 to 2.3.1 Bumps [@github/combobox-nav](https://github.com/github/combobox-nav) from 2.1.7 to 2.3.1. - [Release notes](https://github.com/github/combobox-nav/releases) - [Commits](github/combobox-nav@v2.1.7...v2.3.1) --- updated-dependencies: - dependency-name: "@github/combobox-nav" dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <[email protected]> * test: add fallback for Element#scrollIntoView * chore: fix eslint warning --------- Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Josh Black <[email protected]> * Add missing CSS vars to legacy-theme (#4193) * oof * Create thirty-mirrors-switch.md * test(vrt): update snapshots * fix missing var * fix parens * test(vrt): update snapshots --------- Co-authored-by: langermank <[email protected]> * Version Packages (#4183) Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> --------- Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Owen Niblock <[email protected]> Co-authored-by: joshblack <[email protected]> Co-authored-by: Katie Langerman <[email protected]> Co-authored-by: langermank <[email protected]> Co-authored-by: primer[bot] <119360173+primer[bot]@users.noreply.github.com> Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
1 parent 64b722c commit c66b808

File tree

4 files changed

+34
-15
lines changed

4 files changed

+34
-15
lines changed

.changeset/purple-bees-warn.md

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+
Fix focus styles in ActionList Item to support more than focus-visible

packages/react/src/ActionList/Item.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -170,7 +170,7 @@ export const Item = React.forwardRef<HTMLLIElement, ActionListItemProps>(
170170
color: getVariantStyles(variant, disabled, inactive).hoverColor,
171171
boxShadow: `inset 0 0 0 max(1px, 0.0625rem) ${theme?.colors.actionListItem.default.activeBorder}`,
172172
},
173-
'&:focus-visible, > a:focus-visible': {
173+
'&:focus-visible, > a:focus-visible, &:focus.focus-visible': {
174174
outline: 'none',
175175
border: `2 solid`,
176176
boxShadow: `0 0 0 2px ${theme?.colors.accent.emphasis}`,

packages/react/src/NavList/__snapshots__/NavList.test.tsx.snap

Lines changed: 16 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -261,7 +261,8 @@ exports[`NavList renders a simple list 1`] = `
261261
}
262262
263263
.c2:focus-visible,
264-
.c2 > a:focus-visible {
264+
.c2 > a:focus-visible,
265+
.c2:focus.focus-visible {
265266
outline: none;
266267
border: 2 solid;
267268
box-shadow: 0 0 0 2px var(--bgColor-accent-emphasis,var(--color-accent-emphasis,#0969da));
@@ -287,7 +288,8 @@ exports[`NavList renders a simple list 1`] = `
287288
}
288289
289290
.c7:focus-visible,
290-
.c7 > a:focus-visible {
291+
.c7 > a:focus-visible,
292+
.c7:focus.focus-visible {
291293
outline: none;
292294
border: 2 solid;
293295
box-shadow: 0 0 0 2px var(--bgColor-accent-emphasis,var(--color-accent-emphasis,#0969da));
@@ -685,7 +687,8 @@ exports[`NavList renders with groups 1`] = `
685687
}
686688
687689
.c6:focus-visible,
688-
.c6 > a:focus-visible {
690+
.c6 > a:focus-visible,
691+
.c6:focus.focus-visible {
689692
outline: none;
690693
border: 2 solid;
691694
box-shadow: 0 0 0 2px var(--bgColor-accent-emphasis,var(--color-accent-emphasis,#0969da));
@@ -711,7 +714,8 @@ exports[`NavList renders with groups 1`] = `
711714
}
712715
713716
.c11:focus-visible,
714-
.c11 > a:focus-visible {
717+
.c11 > a:focus-visible,
718+
.c11:focus.focus-visible {
715719
outline: none;
716720
border: 2 solid;
717721
box-shadow: 0 0 0 2px var(--bgColor-accent-emphasis,var(--color-accent-emphasis,#0969da));
@@ -1150,7 +1154,8 @@ exports[`NavList.Item with NavList.SubNav does not have active styles if SubNav
11501154
}
11511155
11521156
.c11:focus-visible,
1153-
.c11 > a:focus-visible {
1157+
.c11 > a:focus-visible,
1158+
.c11:focus.focus-visible {
11541159
outline: none;
11551160
border: 2 solid;
11561161
box-shadow: 0 0 0 2px var(--bgColor-accent-emphasis,var(--color-accent-emphasis,#0969da));
@@ -1176,7 +1181,8 @@ exports[`NavList.Item with NavList.SubNav does not have active styles if SubNav
11761181
}
11771182
11781183
.c4:focus-visible,
1179-
.c4 > a:focus-visible {
1184+
.c4 > a:focus-visible,
1185+
.c4:focus.focus-visible {
11801186
outline: none;
11811187
border: 2 solid;
11821188
box-shadow: 0 0 0 2px var(--bgColor-accent-emphasis,var(--color-accent-emphasis,#0969da));
@@ -1629,7 +1635,8 @@ exports[`NavList.Item with NavList.SubNav has active styles if SubNav contains t
16291635
}
16301636
16311637
.c11:focus-visible,
1632-
.c11 > a:focus-visible {
1638+
.c11 > a:focus-visible,
1639+
.c11:focus.focus-visible {
16331640
outline: none;
16341641
border: 2 solid;
16351642
box-shadow: 0 0 0 2px var(--bgColor-accent-emphasis,var(--color-accent-emphasis,#0969da));
@@ -1663,7 +1670,8 @@ exports[`NavList.Item with NavList.SubNav has active styles if SubNav contains t
16631670
}
16641671
16651672
.c4:focus-visible,
1666-
.c4 > a:focus-visible {
1673+
.c4 > a:focus-visible,
1674+
.c4:focus.focus-visible {
16671675
outline: none;
16681676
border: 2 solid;
16691677
box-shadow: 0 0 0 2px var(--bgColor-accent-emphasis,var(--color-accent-emphasis,#0969da));

packages/react/src/__tests__/__snapshots__/Autocomplete.test.tsx.snap

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -747,7 +747,8 @@ exports[`snapshots renders a menu that contains an item to add to the menu 1`] =
747747
}
748748
749749
.c3:focus-visible,
750-
.c3 > a:focus-visible {
750+
.c3 > a:focus-visible,
751+
.c3:focus.focus-visible {
751752
outline: none;
752753
border: 2 solid;
753754
box-shadow: 0 0 0 2px var(--bgColor-accent-emphasis,var(--color-accent-emphasis,#0969da));
@@ -1489,7 +1490,8 @@ exports[`snapshots renders a multiselect input 1`] = `
14891490
}
14901491
14911492
.c3:focus-visible,
1492-
.c3 > a:focus-visible {
1493+
.c3 > a:focus-visible,
1494+
.c3:focus.focus-visible {
14931495
outline: none;
14941496
border: 2 solid;
14951497
box-shadow: 0 0 0 2px var(--bgColor-accent-emphasis,var(--color-accent-emphasis,#0969da));
@@ -2290,7 +2292,8 @@ exports[`snapshots renders a multiselect input with selected menu items 1`] = `
22902292
}
22912293
22922294
.c3:focus-visible,
2293-
.c3 > a:focus-visible {
2295+
.c3 > a:focus-visible,
2296+
.c3:focus.focus-visible {
22942297
outline: none;
22952298
border: 2 solid;
22962299
box-shadow: 0 0 0 2px var(--bgColor-accent-emphasis,var(--color-accent-emphasis,#0969da));
@@ -2316,7 +2319,8 @@ exports[`snapshots renders a multiselect input with selected menu items 1`] = `
23162319
}
23172320
23182321
.c8:focus-visible,
2319-
.c8 > a:focus-visible {
2322+
.c8 > a:focus-visible,
2323+
.c8:focus.focus-visible {
23202324
outline: none;
23212325
border: 2 solid;
23222326
box-shadow: 0 0 0 2px var(--bgColor-accent-emphasis,var(--color-accent-emphasis,#0969da));
@@ -2955,7 +2959,8 @@ exports[`snapshots renders a single select input 1`] = `
29552959
}
29562960
29572961
.c3:focus-visible,
2958-
.c3 > a:focus-visible {
2962+
.c3 > a:focus-visible,
2963+
.c3:focus.focus-visible {
29592964
outline: none;
29602965
border: 2 solid;
29612966
box-shadow: 0 0 0 2px var(--bgColor-accent-emphasis,var(--color-accent-emphasis,#0969da));
@@ -3408,7 +3413,8 @@ exports[`snapshots renders with a custom text input component 1`] = `
34083413
}
34093414
34103415
.c3:focus-visible,
3411-
.c3 > a:focus-visible {
3416+
.c3 > a:focus-visible,
3417+
.c3:focus.focus-visible {
34123418
outline: none;
34133419
border: 2 solid;
34143420
box-shadow: 0 0 0 2px var(--bgColor-accent-emphasis,var(--color-accent-emphasis,#0969da));

0 commit comments

Comments
 (0)