Skip to content

Improve screen reader output for show leds block#11391

Merged
riknoll merged 4 commits into
microsoft:masterfrom
microbit-matt-hillsdon:show-leds-sr
Jun 10, 2026
Merged

Improve screen reader output for show leds block#11391
riknoll merged 4 commits into
microsoft:masterfrom
microbit-matt-hillsdon:show-leds-sr

Conversation

@microbit-robert

Copy link
Copy Markdown
Contributor

This PR:

  • Provides aria information for the show leds block
    • Adds a label that includes how many LEDs are on
    • Adds grid popup semantics (not exactly what a sighted user sees, but a consistent approach across field editors)
  • Updates individual LED labels to indicate if they are on or off
  • Addresses an id clash which is a result of using sourceBlock_.id
    • The same id is used for the flyout and workspace for the first inserted show leds block - this causes aria-activedescendant to fail causing screen reader problems when navigating inside the grid
  • Adds a updateFocusIndicator method to ensure that the two tone focus indicator is updated when the LEDs are toggled on and off (unintentionally broken by https://github.com/microsoft/pxt/pull/11301/changes#diff-84524797c860e262a8416d54b981fa43859564638b17676b040481db4ee05b7dR150-R152)

microbit-robert and others added 2 commits June 9, 2026 13:47
sourceBlock_.id clashed between the flyout and workspace copy of a block which
caused screen reader bugs when trying to use ids derived from it to identify an
active descendant.
Comment thread pxtblocks/fields/field_matrix.ts Outdated
"aria-hidden": "true"
});
} else {
cell.children[3]?.remove();

@riknoll riknoll Jun 10, 2026

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

hmmm are we sure that subclasses of this matrix field will always have the same number of elements? might be better to tag this child with a data attribute and search for it instead of hardcoding an index

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

We are not. This commit uses a data attribute to keep track of the two tone focus rect. It also fixes a bug where a two tone focus rect was removed when it was still wanted. 8aa194b

Fixes bug where two tone focus indicator was remove when it was still wanted.
@microbit-robert microbit-robert requested a review from riknoll June 10, 2026 20:02
@riknoll riknoll enabled auto-merge (squash) June 10, 2026 22:22
@riknoll riknoll merged commit df308f1 into microsoft:master Jun 10, 2026
12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants