Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -85,4 +85,15 @@ export const useAdditionalInitializersStyles = makeStyles({
flexDirection: 'column',
gap: tokens.spacingVerticalXXS,
},
srOnly: {
position: 'absolute',
width: '1px',
height: '1px',
padding: '0',
margin: '-1px',
overflow: 'hidden',
clip: 'rect(0,0,0,0)',
whiteSpace: 'nowrap',
borderWidth: '0',
},
})
Original file line number Diff line number Diff line change
Expand Up @@ -187,11 +187,13 @@ function ParameterField({ parameter, value, disabled, onChange }: ParameterField
const selected = Array.isArray(value) ? value : []
return (
<Field label={label} hint={parameter.description ?? undefined}>
<div className={styles.checkboxGroup} role="group" aria-label={parameter.name}>
<div className={styles.checkboxGroup} role="group" aria-labelledby={`param-${parameter.name}-group-label`}>
<span id={`param-${parameter.name}-group-label`} className={styles.srOnly}>{label}</span>
{(parameter.choices ?? []).map((choice) => (
<Checkbox
key={choice}
id={`param-${parameter.name}-${choice}`}
aria-label={choice}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fluent’s Field still injects aria-labelledby, which takes precedence over aria-label, so these may still be announced as “tags.” We could explicitly connect each checkbox to its own label:

const choiceLabelId = `param-${parameter.name}-${choice}-label`

<Checkbox
  label={{ children: choice, id: choiceLabelId }}
  aria-labelledby={choiceLabelId}
/>

label={choice}
checked={selected.includes(choice)}
disabled={disabled}
Expand Down
Loading