Open WilcoFiers opened 8 months ago
The ARIA Authoring Practices (APG) Task Force just discussed Label requirements for inputs in grids
.
Based on discussion in today's meeting, moving to ARIA for discussion.
I think it is expected from screen readers like Jaws that they query on input focus the parent cell relationship to its row/column header label and speak that. Because this is implicit, validators checking directly for explicit label properties of the focused control are left out in the cold.
But reality shows that this lookup evaluation is not done consequently by some screen readers yielding in the effect if you TAB from one input to the next (instead using cell navigation), no column label will be spoken at all.
These effects lead to the somehow superfluous situation that authors need to apply extra labelling for the contained controls to satisfy validators and to ensure a good user experience.
There is definitely a need for auto-labelling of embedded form elements using the relation of the parent cell to its row/col header accessible Name, not only for textboxes but also for checkboxes etc.
Technically, it has to be discussed if this auto-labelling could be done by the browser or by assistive technology. In any case, validators need a clear perspective what they can expect. This can be accomplished for instance by advising to check if the direct parent has a headers relation that serves as a label assignment.
I generally label the inputs with at least the column headers. Column and row headers as labels can be ideal assuming the row header is not too long. I understand the auto labelling idea would be a nice catch all but it also creates a risk of labels that might not be as descriptive and concise as we would like.
Memorializing (per request) my suggestion on the WG call that this may be worth discussing in Accessible Name spec. Can we calculate field accName when in well-formed tables, with override for explicit naming.
Discussed today during new issue triage: https://www.w3.org/2024/03/14-aria-minutes.html
I think, there are following situations and their combinations to have in mind:
IMO: The best way is to engage the screen reader calculation as follows:
If the aria-label set on an only widget in a cell / gridcell is identical with the concatenation:
If, again, there is only one widget in the cell, and the author lets it intentionally without label/title atc, setting non-blank content in both ros and column headers, then it shuld be sufficient for screen readers / evaluation tools as a correct label for the widget.
Discussed on today's call https://www.w3.org/2024/03/28-aria-minutes.html#t05
Discussed in the ARIA WG April 4th 2024
@aardrian mentioned wanting to discuss this as a deep dive topic. Possibly April 25th, 2024. Including multiple fields in the same cell.
For any form control that has no accName (from 2.A through 2.I of the Accessible Name and Description Computation 1.2), I am going to propose a new step to calculate an accName from the corresponding row and column headers.
cell
within a table
or grid
.cell
has a column and/or row header (columnheader
, rowheader
).This will not prevent multipled controls in the same cell from having the same accName nor is it meant to.
This proposal is not meant to create usable accNames, but instead to provide an accName. The logic for how to determine a usable accName solely from context can make this unwieldy to implement (never mind bogged down in debate).
Screen readers should be encouraged not to expose the control's accName when the user is moving into a cell in a way that would announce either the column or row header.
It may be worth exposing the header that is not announced (if a user moves into a new column, the row header will already be announced but the row header may be useful to re-announce as the accName, or not). I expect this will elicit debate, which is fine. I expect SR makers to be in a better position than I to debate that.
The goal here:
Again, this is not meant to be perfect. It is meant to be a final fallback for users who have not been provided with accNames from authors.
This is my pitch for the deep dive.
ping @spectranaut @jnurthen as I am new to the deep dive process.
Minutes from the deep dive: https://www.w3.org/2024/05/02-aria-dive-minutes
general consensus is that we should go forward with this
I'm wondering if there are any updates here? I am working on web applications that are running into this same issue, and there is some internal debate on whether we should be including labels on input controls within 'grid' role element cells to appease axe at the expense of having them read out twice due to column headers also having the same values, or whether we should be ignoring the label requirements that axe is flagging since the headers result in the expected information being conveyed to assistive technology users.
We got a question in axe-core recently asking if form fields inside a data grid required an accessible name. My expectation is that it does. The textfield role requires an accessible name after all. But it looks like APG's data grid example 2 does not set an accessible name on the input element when a cell is edited:
https://www.w3.org/WAI/ARIA/apg/patterns/grid/examples/data-grids/#ex2_label