Skip to content

Accessibility: Add aria attributes to site tree #2000

@emteknetnz

Description

@emteknetnz

Split from - silverstripe/silverstripe-cms#3101

WAI-ARIA Tree View Pattern

The CMS page site tree lacks aria attributes

Context

The site tree in /admin/pages/ had almost no keyboard interactivity even though there were various functions possible with mouse interaction.

The relevant keyboard interaction will have been added through the "related" issues below, but screen readers probably don't give necessary hints to blind users.

Proposed ARIA-attributes

Main Container

  • The main container should have role="tree". This tells screen readers that the element contains a hierarchical structure.

Pages

  • Each page item within the tree should have role="treeitem".
  • To indicate nesting levels, use aria-level (e.g., aria-level="1" for top-level pages, aria-level="2" for their children).
  • For pages with nested children, use aria-expanded="false" when the list is collapsed and aria-expanded="true" when it's open.

Expand/Collapse Arrow

  • Icons controlling the expand/collapse action should have a dynamic and descriptive aria-label, such as "Toggle child pages".

Mouse Drag-and-Drop

Notes

Related

Acceptance criteria

  • Screen readers give sensible instructions and labels where appropriate
  • Icons related to the above actions are not read out (i.e. linked issue above)

Kitchen-sink CI

^^ failures are existing

PRs

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions