Skip to content

[5.x]: Non-distinct labels for dashboard nav items containing subitems #15006

@JamieC24

Description

@JamieC24

What happened?

Description

When using the Craft admin system as a screen-reader user, buttons to expand navigation items that have a sub-navigation are simply labeled “Open subnavigation”. When there are several navigation items that contain subnavigation, the same label is applied to each of them, making it unclear to the user which subnavigation they’re opening

Steps to reproduce

  1. Activate VoiceOver (if you’re using a Mac) or Narrator (if you’re using a Windows machine)
  2. Navigate to https://cms-bookshare.studio24.dev/admin and log in
  3. Tab through the navigation in the sidebar of the dashboard until you reach an item with a subnavigation

Expected behaviour

The screen-reader should indicate to the user which nav item the subnavigation is associated with (i.e “Open Subnavigation - GraphQL”)

Actual Behaviour

The screen-reader reads out “Open subnavigation”

Proposed solution

I have been able to fix this locally by changing line 83 of the global-sidebar.twig template to the following:

{{ 'Open subnavigation' |t('app') ~ ': ' ~ item.label }}

Craft CMS version

Craft CMS Pro 5.1.0

PHP version

8.2.18

Operating system and version

MacOS Sonoma 14.4.1

Database type and version

PostgreSQL 15.8

Image driver and version

No response

Installed plugins and versions

CK Editor 4.0.4

Postmark 3.1.0

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions