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
Reimpliment accessibility based on WAI-ARIA 1.1 #1023
Conversation
Review status: 0 of 11 files reviewed at latest revision, 1 unresolved discussion, some commit checks failed. vaadin-grid.html, line 32 at r1 (raw file):
We probably don't want Comments from Reviewable |
Review status: 0 of 11 files reviewed at latest revision, 1 unresolved discussion, some commit checks broke. vaadin-grid.html, line 32 at r1 (raw file): Previously, limonte (Limon Monte) wrote…
Done. Comments from Reviewable |
Looks like cell text can no longer be selected in the grid. I think it was a regression in a previous PR = can be fixed in a separate PR if you prefer. Comments from Reviewable |
Tested on NVDA+Chrome, works nice Reviewed 8 of 11 files at r1, 3 of 3 files at r2. Comments from Reviewable |
Reviewed 8 of 11 files at r1, 3 of 3 files at r2. Comments from Reviewable |
Reviewed 2 of 2 files at r3. Comments from Reviewable |
Fixes #1015 - Use `aria-rowcount`, `aria-colcount` on table - Use `aria-rowindex` on rows to indicate row numbers - Use `aria-selected` on cells to indicate selection - Use `aria-expanded`, `aria-controls` on cells to indicate row details toggle states - `<vaadin-grid-sorter>` sets `aria-sort` on parent cells - Add tests for all above and structural grid/row/gridcell roles in HTML - Remove hardcoded english textual announcements
I stumbled over this issue, thank you so much for adressing this! Did you consider the following things?
Update after a developer from w3c aria team answered some questions:
|
@knoobie thanks for participating in this review and asking questions. I believe it is helpful for us to go through them.
Yes, done so. All the columns are not sortable by default, hence don’t have
The value of When multisorting is in use, more than one column header can have I find
Tricky questions. The grid is agnostic to selection model that developers using the grid use. There are no “selection modes” to choose from, both multiple selection as well as single selection is allowed out-of-the-box. You can think of it this way: multiple selection is allowed by default in the API, but selection not triggered by default when end users interact with the grid. Developers can trigger selection the way then want by calling the grid APIs. The resulting selection model can be anything: single, multiple selection, both of them in any combination. See grid examples of different selection modes: https://cdn.vaadin.com/vaadin-grid/4.0.0-alpha3/demo/#grid-selection-demos So the grid does not know whether developers implement single or multiple selection modes. After trying how it works with screen readers, I haven’t noticed any downsides of having For same reasons all items have
API-wise the selection can be only on rows, or in other words, on the grid items. However, both rows and cells in this PR have In future, we might rethink keyboard navigation making rows focusable as well in the grid, but don’t have resources for that currently.
Developers can hide columns using the By spec, when
Done.
Footer rows also have First of all, this is what the spec says: “However, if only a portion of the rows is present in the DOM at a given moment, this attribute is needed to provide an explicit indication of each row's position with respect to the full table.” (Source: Let’s say, a grid has one row for header, one row for footer, there is 100 items in total, but only 50 of them is actually in the DOM as body rows. The full table is contains 102 rows then. I would expect the footer row to have position of Missing explicit Since the footer rows use explicit |
@platosha Thank you for your detailed answer!
👍 - I know 'other' is a special use-case. I still hope for an aria-sort-order='Integer' but using it your way is fine as well! It's kinda a philosophical question, who likes what more.
I can understand your concerns and implementation! If it's currently not possible to determine whether the 'user/developer' wants to use single or multiselect, it would be lovely if aria-multiselectable and aria-selected are only added if the developer has any kind of selection allowed. Default behaviour of the grid should be 'unselectable', or?
I think I found somewhere a keyboard navigation guide written by w3c how the grid should perform, but idk if this is what your Usability Engineer wants in the end.
👍
I had the same questions in mind some days ago, where I wanted to add this to the vaadin framework. I opened an issue (w3c/aria-practices#465) where this was answered by a staff member from aria-practice. That's why I wanted to include it here as well. Edit: Please ping me if you have the latest branch somewhere deployed, I can ask a sightless colleague mid october if he has any problems using the latest version! |
My decision is to have selectable default for now. This could confusing for end users, but I believe they still can try selecting items and discover that they can’t trigger selection. On the other hand, having unselectable default might confuse end users to not even try selection while it is available, so they won’t discover selection feature at all. This is worse than the current default IMO.
We have been this WAI-ARIA Authoring Practices for Grid guide back in the day when developing keyboard navigation for grid v2.0. Keyboard navigation in the grid works in the spec way with a few minor exceptions.
Thanks for explaining your reasoning. I assume that footer rows can be included in a similar way the header rows are. Neither the spec text, nor the referred examples, nor the staff member’s response explicitly disagree with that. |
@platosha I agree with your reasoning! I've added the link with the keyboard navigation above in the comment and added an edit below. I think this is a really good starting point for Grid 4.0! Kudos! |
This is based on discussion from vaadin/vaadin-grid#1023 .
Fixes #1015
Use
aria-rowcount
,aria-colcount
on tableUse
aria-rowindex
on rows to indicate row numbersUse
aria-selected
on cells to indicate selectionUse
aria-expanded
,aria-controls
on cells to indicate row detailstoggle states
<vaadin-grid-sorter>
setsaria-sort
on parent cellsAdd tests for all above and structural grid/row/gridcell roles in HTML
Remove hardcoded english textual announcements
This change is