A checkbox should be named by everything drawn beside it

Open
#298 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
42/100
Issue type
Refactor
Clarity
Mostly clear
Activity status
Active
Tech stack
javascript

Research direction

Start at nameOf and the NAMED list in features/tasks/index.js and read how the checkbox's aria-label is assembled today. Then look at the patterns the issue points to: sectionsDone in the sections feature, and how fields builds aria-labelledby for its date and choice groups; also find where qa assembles choice and progress names. Before editing, work out how ids are generated so they stay unique across a deck's slides and the asides' parses, since those share line numbers. Done looks like each box naming itself via aria-labelledby spans, with NAMED, nameOf and tasks' requires: ['date'] gone and existing reader/qa tests updated.

Written by the indexing model from the issue text.

Description

accessibility bug

A checkbox or a choice is named, for a screen reader, by the words beside it. tasks puts that name together itself (nameOf in features/tasks/index.js), from the line's text and from a list of other features' tokens it knows about (NAMED). Anything else drawn beside the box is read as typed or left out, so the name and the page disagree.

- [ ] :tada: Party
- ( ) Sat :sunny:
- [ ] [link](#x){blue} after
- [ ] [@ blank]{red} Call
  1. Open it in reader with a screen reader, or look at each box's aria-label.

Today: the boxes are named "🎉 Party", "Sat ☀️", "link{blue} after" and "blank{red} Call", while the page shows 🎉 and ☀️, and no braces, which style the link and the blank (#303). A feature tasks doesn't list, including one an author adds for themselves, is read the same way, and the only fix is a change to tasks naming it. Before #275, a date beside a box was dropped from its name the same way.

Instead: a box's name is what's drawn beside it, whatever drew it: an emoji as its character, a date as its words, a link as its text, and anything a feature reader doesn't know about as what it shows.

Suggested fix

Let the browser work out the name: wrap the item's own words in a span with an id, and point the box at it with aria-labelledby, as a heading's Done button already does (sectionsDone) and as fields does for its date and choice groups. Unlike a <label>, it doesn't pass clicks on a link among the words to the box.

  • Ids have to be unique on the page, including a deck's slides and the asides' own parses, which share line numbers.
  • A staged box ("Stage the kickoff: 1 of 3") and a Done button ("Done: Plan") add words to the name: a span of their own in the aria-labelledby list, or aria-describedby.
  • qa's choices and progress put names together the same way, and would follow.
  • NAMED, nameOf and tasks' requires: ['date'] (from #275) go, so the order of features no longer matters for names (#296).
Dominant language
JavaScript
Stars
0
Forks
1
Avg merge
2d 4h
Merged PRs (30d)
26

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from jzheaux/reader

All issues in jzheaux/reader

Similar issues

More JavaScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.