-
Bug
-
Resolution: Fixed
-
Minor
-
4.4
(Note: This is the first in a possible series of bugs that have been raised by our accessibility testing team.)
In Moodle, form fields that are required show a red ! icon with ARIA label and title 'required', but this is not part of the form label and will not be read out by a screenreader while navigating form fields. When they go to the form field, screenreader users do not know it is required.
To reproduce, using NVDA (open source):
- Go to Site administration / Courses / Add a new course
- Tab through the controls on the page until you get to the course full name box
EXPECTED: At some point it should tell you that the box is required.
ACTUAL: When you get to the box it just says "Course full name edit blank"
Note that if you instead read all page content using arrow keys, you would get to the required icon, but it ought to work in forms mode (tab key).
There are two ways to solve this problem:
1 Move the required icon within the <label> tag. This way it would be read as part of the label; 'Course full name required edit blank'.
2 Add the aria:required attribute to the input field (and, where possible, other types of field). This way it would be read (in NVDA, other screen readers might put it somewhere different) after the field type 'Course full name edit required blank'.
Either of these would be acceptable according to our accessibility team.
Because of the way the styling works in Moodle I think it will be a safer change to add aria:required attribute, so I'm going to implement that approach for most field types.
NOTE: When you tab off the field, there is additional notification of the required state in a line below, which results in another accessibility bug that I might work on once I get this one done! But it should be possible to get the information when you arrive at the field, not only after you leave it, so this bug is still valid.