Skip to content

fix: set role application and fix block readouts#9747

Merged
maribethb merged 2 commits intoRaspberryPiFoundation:v13from
maribethb:role-app
Apr 22, 2026
Merged

fix: set role application and fix block readouts#9747
maribethb merged 2 commits intoRaspberryPiFoundation:v13from
maribethb:role-app

Conversation

@maribethb
Copy link
Copy Markdown
Contributor

The basics

The details

Resolves

Fixes #9666

Proposed Changes

  • Sets role=application on the blockly subcontainer
  • Sets block labels and other aria states on the focusable element of the block, not its svg root
  • sets role=presentation on the block's svgRoot to exclude the extraneous elements from the accessibility tree. this matches what we've done in the screenreader experiment branch

Reason for Changes

block labels weren't being read correctly because the browser focuses the path object's svg path, not the block's svg root. now the methods call the block's getFocusableElement so that the roles are set on the focused element (even if in the future that element becomes e.g. the svg root rather than the path object)

Test Coverage

updated tests to assert on the correct focusable element as well

Documentation

Additional Information

@maribethb maribethb requested a review from a team as a code owner April 22, 2026 16:18
@maribethb maribethb requested a review from gonfunko April 22, 2026 16:18
@github-actions github-actions Bot added the PR: fix Fixes a bug label Apr 22, 2026
@maribethb maribethb merged commit 44d8554 into RaspberryPiFoundation:v13 Apr 22, 2026
9 of 10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

PR: fix Fixes a bug

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants