Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Global styles panel header is a menubar ARIA role with missing required menu items #58313

Closed
afercia opened this issue Jan 26, 2024 · 1 comment · Fixed by #58740
Closed

Global styles panel header is a menubar ARIA role with missing required menu items #58313

afercia opened this issue Jan 26, 2024 · 1 comment · Fixed by #58740
Assignees
Labels
[Focus] Accessibility (a11y) Changes that impact accessibility and need corresponding review (e.g. markup changes). Global Styles Anything related to the broader Global Styles efforts, including Styles Engine and theme.json [Package] Edit Site /packages/edit-site [Package] Interface /packages/interface [Status] In Progress Tracking issues with work in progress [Type] Bug An existing feature does not function as intended

Comments

@afercia
Copy link
Contributor

afercia commented Jan 26, 2024

Description

Tje top part of the Global Styles panel is an element with role="menubar" and aria-label="Styles actions" that wraps soem buttons (with the exception of the 'Close' button). Screenshot:

Screenshot 2024-01-26 at 14 20 06

A menubar can only contain elements with role group, menuitem and the menuitems variants. It can not contain anything else. Reference:

https://www.w3.org/TR/wai-aria-1.2/#menubar
Required Owned Elements:

  • group → menuitem
  • group → menuitemradio
  • group → menuitemcheckbox
  • menuitem
  • menuitemcheckbox
  • menuitemradio

Instead:

  • The buttons within the menubar are normal buttons with no role.
  • The text 'Styles' is stray text with no semantis other than emphasis because of the <strong> element that wraps it.

Step-by-step reproduction instructions

  • Go to Site Editor > Styles.
  • Inspect the elements in the top bar of the Styles panel.
  • Observe the element that contains the 'Styles' text and the following buttons has a role="menubar".
  • Observe the buttons 'Style Book', 'Revisions', 'More', have no role.

Screenshots, screen recording, code snippet

No response

Environment info

No response

Please confirm that you have searched existing issues in the repo.

Yes

Please confirm that you have tested with all plugins deactivated except Gutenberg.

Yes

@afercia afercia added the [Type] Bug An existing feature does not function as intended label Jan 26, 2024
@jordesign jordesign added the Global Styles Anything related to the broader Global Styles efforts, including Styles Engine and theme.json label Jan 28, 2024
@afercia afercia self-assigned this Feb 6, 2024
@afercia
Copy link
Contributor Author

afercia commented Feb 6, 2024

Looks like the menubar role was added in #51318 but the button weren't changed to menuitems neither arrow navigation was implemented.

After looking a bit into this, I think the best option is:

  • Remove the menubar role. It doesn't make much sense to use a menu semantics. These buttons are 'toggle buttons': they toggle other parts of the UI rather than executing commands.
  • Make the 'Styles' text a H2 heading.
  • Improve the semantics of all side panels (under the hood they are powered by the ComplementaryArea component) by making sure the default visible title is a H2 heading.

@afercia afercia added [Package] Interface /packages/interface [Package] Edit Site /packages/edit-site [Focus] Accessibility (a11y) Changes that impact accessibility and need corresponding review (e.g. markup changes). labels Feb 6, 2024
@github-actions github-actions bot added the [Status] In Progress Tracking issues with work in progress label Feb 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Focus] Accessibility (a11y) Changes that impact accessibility and need corresponding review (e.g. markup changes). Global Styles Anything related to the broader Global Styles efforts, including Styles Engine and theme.json [Package] Edit Site /packages/edit-site [Package] Interface /packages/interface [Status] In Progress Tracking issues with work in progress [Type] Bug An existing feature does not function as intended
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants