Skip to content
Open
Show file tree
Hide file tree
Changes from 15 commits
Commits
Show all changes
16 commits
Select commit Hold shift + click to select a range
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
5 changes: 5 additions & 0 deletions .changeset/five-seas-walk.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@khanacademy/perseus": patch
---

fix - add roles to ul and li items to make sure they are visible to screen readers
4 changes: 2 additions & 2 deletions packages/perseus/src/widgets/radio/choice.new.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,8 @@ const Choice = (props: IndicatorProps) => {
Therefore, WCAG 2.1.1 is still satisfied since functionality is
aligned with the input method.
*/
// eslint-disable-next-line jsx-a11y/click-events-have-key-events,jsx-a11y/no-noninteractive-element-interactions
<li className={classes} onClick={clickHandler}>
// eslint-disable-next-line jsx-a11y/click-events-have-key-events,jsx-a11y/no-noninteractive-element-interactions, jsx-a11y/no-redundant-roles
<li className={classes} onClick={clickHandler} role="listitem">
Copy link
Contributor

Choose a reason for hiding this comment

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

I wonder if some of these rules are helpful if we need to keep overriding them in our efforts to have a good a11y experience. 🤔

<Indicator
buttonRef={buttonRef}
checked={props.checked}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -119,9 +119,11 @@ const MultipleChoiceComponent = ({
{instructions}
</legend>
<ScrollableView id={scrollId} overflowX="auto">
{/* eslint-disable-next-line jsx-a11y/no-redundant-roles */}
<ul
aria-labelledby={legendId}
className={choiceListClasses}
role="list"
>
<ChoiceListItems
choices={choices}
Expand Down
Loading