Make WordPress Core

Opened 2 years ago

Closed 2 years ago

Last modified 11 months ago

#61795 closed defect (bug) (invalid)

Lighthouse shows invalid ARIA role error for role="group"

Reported by: dilipbheda Owned by:
Priority: normal Milestone:
Component: Toolbar Version:
Severity: normal Keywords: has-patch has-test-info close
Cc: Focuses: ui, accessibility

Description

I've found the Accessibility role error in the admin bar.
Ref: https://tinyurl.com/2cp6mj4c

As per the ARIA docs suggestion, we can fix it by adding a none role in the li tag.
Docs: https://dequeuniversity.com/rules/axe/4.9/aria-allowed-role

Attachments (1)

61795.patch (621 bytes ) - added by dilipbheda 2 years ago.

Download all attachments as: .zip

Change History (12)

@dilipbheda
2 years ago

#1 @narenin
2 years ago

  • Keywords has-testing-info added

Test Report

I have tested latest patch and it is working as expected. https://core.trac.wordpress.org/attachment/ticket/61795/61795.patch

Environment

WordPress: 6.7-alpha-58576-src
PHP: 8.1.23
Server: nginx/1.16.0
Database: mysqli (Server: 8.0.16 / Client: mysqlnd 8.1.23)
Browser: Chrome 126.0.0.0 (macOS)
Theme: Twenty Twenty Version: 2.7

Expected Results

✅ Aria role error has been fixed.

Screenshot (Before Patch) - https://prnt.sc/ys7Sq7EI92PX
Screenshot (After Patch) - https://prnt.sc/34-zMvx9-wVn

#2 @sabernhardt
2 years ago

  • Component AdministrationToolbar
  • Summary Accessibility: Lighthouse show in valid ARIA role error.Lighthouse shows invalid ARIA role error for role="group"

Related: #60919

#3 @joedolson
2 years ago

  • Keywords close added

The test in Lighthouse is incorrect; the group role is permitted on list items as long as the parent list does *not* have the list role. The parent node in this case is a ul with role="menu", so it is correct.

This is correct per the HTML ARIA specifications for `li`.

Recommend closing.

This ticket was mentioned in Slack in #accessibility by joedolson. View the logs.


2 years ago

#5 @joedolson
2 years ago

  • Milestone Awaiting Review
  • Resolutioninvalid
  • Status newclosed

Closing as invalid following discussion in the accessibility bug scrub.

#6 @phatakraj
21 months ago

I recently face this, but as read above mentioned. Now How to fix this? Is this forum closed?

Last edited 15 months ago by phatakraj (previous) (diff)

#7 @joedolson
20 months ago

You're welcome to make comments if you believe that this is a problem that needs to be addressed. However, we're not going to remove existing semantics just because some testing tools incorrectly register this as an error.

#8 @wordpressdotorg
15 months ago

  • Keywords has-test-info added; has-testing-info removed

#9 @joedolson
15 months ago

#63542 was marked as a duplicate.

#10 @yanshgupta
13 months ago

Thank you for the clarification. I completely understand the reasoning behind keeping the current semantics. That said, I’ve also encountered the same ARIA role error in my environment, particularly in the admin bar. Just wanted to share in case it’s helpful for ongoing accessibility considerations. Appreciate the team's attention to detail!

Last edited 12 months ago by yanshgupta (previous) (diff)

#11 @phatakraj
12 months ago

It's great to know the semantics are working as intended overall, but your note about the ARIA role in the admin bar is definitely valuable. We'll keep that in mind as we continue refining accessibility across the board. Really appreciate your thoughtful input and attention to detail as well!

Last edited 11 months ago by phatakraj (previous) (diff)
Note: See TracTickets for help on using tickets.