Skip to content

Conversation

@gonfunko
Copy link
Contributor

@gonfunko gonfunko commented Feb 10, 2025

The basics

The details

Resolves

Fixes #2481

Proposed Changes

This PR updates the grid field to improve its accessibility. Specifically:

  • The focused item in the grid can now be navigated using the left and right arrow keys, in addition to up and down.
  • The grid is no longer a menu, but instead is an element with aria-role grid, made up of rows and cells with the appropriate roles.
  • Items are scrolled into view when navigation exceeds the bounds of the dropdown div

Breaking Changes

Since this field no longer uses menus as its backing representation, the CSS class structure has changed dramatically. Broadly speaking, .blocklyFieldGrid targets the grid itself, and .blocklyFieldGridItem targets each individual item. For details, refer to the CSS registered at the end of index.ts.

@gonfunko gonfunko changed the title feat: Improve accessibility of the grid field. feat!: Improve accessibility of the grid field. Feb 13, 2025
@gonfunko gonfunko merged commit e35406b into RaspberryPiFoundation:rc/v12.0.0 Feb 13, 2025
8 checks passed
@gonfunko gonfunko deleted the grid-nav branch February 13, 2025 19:41
cpcallen pushed a commit to cpcallen/blockly-samples that referenced this pull request May 7, 2025
…n#2488)

* feat!: Improve accessibility of the grid field.

* chore: Fix lint problems.

* chore: Clarify comments.

* refactor: Limit imports.

* refactor: Include `field` in CSS class names.

* refactor: Move grid item population into its own function.

* refactor: Use null instead of undefined for selection callback.
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.

2 participants