craftcms / cms

Build bespoke content experiences with Craft.
https://craftcms.com
Other
3.27k stars 635 forks source link

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

Closed JamieC24 closed 4 months ago

JamieC24 commented 5 months ago

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

gcamacho079 commented 5 months ago

Thanks for reporting this issue, @JamieC24. I’ve raised a PR for this.

brandonkelly commented 4 months ago

Craft 5.2.0 is out with a fix for this. Thanks again!