Skip to content

Commit bc17241

Browse files
authored
Merge branch 'main' into pk/export-select-panel
2 parents 05e4215 + 39a3bc2 commit bc17241

File tree

12 files changed

+22
-5
lines changed

12 files changed

+22
-5
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+
ActionMenu v2: Add aria-expanded to the ActionMenu.Button

.changeset/breezy-coats-play.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+
Adds aria-hidden="true" to InputLabel required asterisk

docs/content/InputField.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ componentId: inputField
33
title: InputField
44
status: Alpha
55
description: The InputField component is used to render a labelled text input and, optionally, associated validation text and hint text.
6-
source: https://github.com/primer/react/blob/main/src/InputField.tsx
6+
source: https://github.com/primer/react/blob/main/src/InputField/InputField.tsx
77
storybook: '/react/storybook?path=/story/forms-inputfield--text-input-field'
88
---
99

docs/content/drafts/ActionMenu2.mdx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -192,7 +192,7 @@ render(
192192

193193
### With External Anchor
194194

195-
To create an anchor outside of the menu, you need to switch to controlled mode for the menu and pass it as `anchorRef` to `ActionMenu`:
195+
To create an anchor outside of the menu, you need to switch to controlled mode for the menu and pass it as `anchorRef` to `ActionMenu`. Make sure you add `aria-expanded` and `aria-haspopup` to the external anchor:
196196

197197
```javascript live noinline
198198
// import {ActionMenu, ActionList} from '@primer/react/drafts'
@@ -204,7 +204,7 @@ const Example = () => {
204204

205205
return (
206206
<>
207-
<Button ref={anchorRef} onClick={() => setOpen(!open)}>
207+
<Button ref={anchorRef} aria-haspopup="true" aria-expanded={open} onClick={() => setOpen(!open)}>
208208
{open ? 'Close Menu' : 'Open Menu'}
209209
</Button>
210210

src/AnchoredOverlay/AnchoredOverlay.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -156,6 +156,7 @@ export const AnchoredOverlay: React.FC<AnchoredOverlayProps> = ({
156156
id: anchorId,
157157
'aria-labelledby': anchorId,
158158
'aria-haspopup': 'true',
159+
'aria-expanded': open,
159160
tabIndex: 0,
160161
onClick: onAnchorClick,
161162
onKeyDown: onAnchorKeyDown

src/_InputLabel.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ const InputLabel: React.FC<Props> = ({children, disabled, required, visuallyHidd
2525
{required ? (
2626
<Box display="flex" as="span">
2727
<Box mr={1}>{children}</Box>
28-
<span>*</span>
28+
<span aria-hidden="true">*</span>
2929
</Box>
3030
) : (
3131
children

src/__tests__/__snapshots__/ActionMenu.test.tsx.snap

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,7 @@ exports[`ActionMenu renders consistently 1`] = `
6868
}
6969
7070
<button
71+
aria-expanded={false}
7172
aria-haspopup="true"
7273
aria-label="menu"
7374
aria-labelledby="react-aria-1"

src/__tests__/__snapshots__/ActionMenu2.test.tsx.snap

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,7 @@ exports[`ActionMenu renders consistently 1`] = `
8080
fontFamily="normal"
8181
>
8282
<button
83+
aria-expanded={false}
8384
aria-haspopup="true"
8485
aria-labelledby="react-aria-1"
8586
className="c1"

src/__tests__/__snapshots__/AnchoredOverlay.test.tsx.snap

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,7 @@ exports[`AnchoredOverlay renders consistently 1`] = `
8080
fontFamily="normal"
8181
>
8282
<button
83+
aria-expanded={false}
8384
aria-haspopup="true"
8485
aria-labelledby="react-aria-1"
8586
className="c1"
@@ -193,6 +194,7 @@ exports[`AnchoredOverlay should render consistently when open 1`] = `
193194
font-family="normal"
194195
>
195196
<button
197+
aria-expanded="true"
196198
aria-haspopup="true"
197199
aria-labelledby="react-aria-1"
198200
class="c1"

src/__tests__/__snapshots__/DropdownMenu.test.tsx.snap

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,7 @@ exports[`DropdownMenu renders consistently 1`] = `
7272
}
7373
7474
<button
75+
aria-expanded={false}
7576
aria-haspopup="true"
7677
aria-labelledby="react-aria-1"
7778
className="c0"

0 commit comments

Comments
 (0)