Opened 7 years ago

Closed 7 years ago

Last modified 6 years ago

#16204 closed defect (fixed)

[PATCH][CCLA] dijit.CheckedMenuItem - add aria-checked to initially empty CheckedMenuIte

Reported by: mikeb Owned by: bill
Priority: undecided Milestone: 1.8.4
Component: Dijit Version: 1.8.1
Keywords: Cc:
Blocked By: Blocking:

Description

If a dijit.CheckedMenuItem? is initially "unchecked" or left blank, than we see an accessibility violation because the node will have role="menuitemcheckbox" but will be missing the required "aria-checked" attribute: http://www.w3.org/TR/wai-aria/roles#menuitemcheckbox

It is left like this until the user toggles the checkbox. The attached patch just sets the aria-checked attribute for the initial checkbox by adding aria-checked="${checked}" in the CheckedMenuItem? template. It also fixes up the Menu test page.

Attachments (2)

checked-menu-item-aria-checked-initially-blank.patch (4.0 KB) - added by mikeb 7 years ago.
adds aria-checked attribute to initally empty CheckedMenuItem?; fixes up test case; please proxy commit for Michael Billau CCLA on file with IBM
backport-CheckedMenuItem-accessibility.patch (8.5 KB) - added by mikeb 6 years ago.
Backport accessibility fixes to CheckedMenuItem? to 1.8 using 29860, please proxy commit for Michael Billau

Download all attachments as: .zip

Change History (9)

Changed 7 years ago by mikeb

adds aria-checked attribute to initally empty CheckedMenuItem?; fixes up test case; please proxy commit for Michael Billau CCLA on file with IBM

comment:1 Changed 7 years ago by bill

Milestone: tbd1.9
Status: newassigned

Hmm, the _setCheckedAttr() constructor sets the aria-checked property... unfortunately (for this case) it isn't getting called on construction, see #7381.

comment:2 Changed 7 years ago by bill

Anyway, the patch seems OK (working around #7381), but it should have tests to make sure that aria-checked is getting set correctly initially, plus that it's getting changed when a CheckedMenuItem is clicked.

comment:3 Changed 7 years ago by bill

Resolution: fixed
Status: assignedclosed

In [29860]:

Make sure aria-checked is set correctly on initially unchecked menu items. Patch Mike Billau (IBM, CCLA), thanks.

Also added tests for the aria-checked attribute.

Fixes #16204 !strict.

comment:4 Changed 6 years ago by mikeb

Is there any way that we can backport this accessibility functionality to 1.8?

I created a patch that just has changes from [29860] in it. I compared the changed pages with the nightly build and there are some differences due to other tickets that weren't backported:

  • templates/CheckedMenuItem.html - nightly has "textDirNode", added from [29594]
  • test/robot/Menu_a11y.html - nightly has additional keyboard tests from [29912] (multiple letter navigation)
  • tests/test_Menu.html - nightly has many changes adding letter navigation from [29912]. Nightly also has an additional aria-label from [29906]. I think [29906] needs to be backported to 1.8 as well but I will attach that patch to the appropriate ticket.

I tested the test pages and they pass the automated tests.

Changed 6 years ago by mikeb

Backport accessibility fixes to CheckedMenuItem? to 1.8 using 29860, please proxy commit for Michael Billau

comment:5 Changed 6 years ago by bill

This seems safe to backport.

comment:6 Changed 6 years ago by Douglas Hays

In [30312]:

Refs #16204. Backport [29860] to 1.8.

comment:7 Changed 6 years ago by Douglas Hays

Milestone: 1.91.8.4
Note: See TracTickets for help on using tickets.