Skip to content
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

Address Table accessibility issues #1151

Closed
atmgrifter00 opened this issue Apr 3, 2023 · 13 comments
Closed

Address Table accessibility issues #1151

atmgrifter00 opened this issue Apr 3, 2023 · 13 comments
Assignees
Labels
enhancement New feature or request

Comments

@atmgrifter00
Copy link
Contributor

atmgrifter00 commented Apr 3, 2023

📌 User Story

The table needs the correct ARIA role.

Once the table row grouping PR goes through, there will be some accessibility issues that will require some follow up work on (some of which will possibly be part of the Table Interaction Keyboard work). Some of the issues raised include:

  • Determine what the appropriate role for the TableGroupRow is (ARIA guidance strongly suggests that the rowgroup role is only appropriate for DOM elements that actually contain row (or other) elements, which our TableGroupRow does not).
  • Determine what the appropriate focus interactions are for the expand/collapse button. We've had some direction that the expand/collapse button shouldn't be focusable, but this seems in conflict with some expected ARIA behaviors.
  • Assuming the expand/collapse button remains a button, we will need to create an API for users to supply it an accessible label, much like we did for the action menu label (except likely exposed on the Table). [Addressed in Add localized labels to remaining table sub-elements #1519]
  • Configure aria-expanded on the group rows, but this requires the table itself to have a role of treegrid. Some questions about this:
    • Should the table always be treegrid or should the role change based on whether or not a column is grouped and whether or not hierarchy is enabled?
    • Does aria-expanded make sense on group rows if the rows beneath it are not child elements in the DOM?
  • Add accessible label to the selection checkboxes in the multi-select case. This should probably be done in a consistent manner as adding a label to the expand/collapse button for group rows. [Addressed in Add localized labels to remaining table sub-elements #1519]

Note: The localization concerns described above are also captured in #1090

Note: When this is fixed, we can also address #1195.

@atmgrifter00
Copy link
Contributor Author

@leslieab, we will likely need to revisit some of the decisions surrounding focus behaviors for the expand/collapse button (see the description above).

@atmgrifter00 atmgrifter00 mentioned this issue Apr 3, 2023
1 task
@leslieab
Copy link
Contributor

leslieab commented Apr 3, 2023

@atmgrifter00 I'm unclear from what you have linked whether those Firefox errors will resolve once we have implemented keyboard interactivity for expand/collapse operations and the parent row has aria-expanded being set? We have elements in the header row that are also not focusable, does FF throw errors for those as well?

@jattasNI jattasNI added this to the Table Milestone 4 milestone Apr 3, 2023
@jattasNI jattasNI added the triage New issue that needs to be reviewed label Apr 3, 2023
@atmgrifter00
Copy link
Contributor Author

atmgrifter00 commented Apr 3, 2023

@leslieab, it would only raise warnings for interactive elements like buttons. At the moment, the header has no such elements.

@msmithNI
Copy link
Contributor

msmithNI commented Apr 3, 2023

@leslieab I'm working on interactive sorting right now. Once we have click handlers on the header elements (to allow for interactive sorting), Firefox will have the same accessibility warning for those ("Clickable elements must be focusable and should have interactive semantics."), unless we make them focusable.

@leslieab
Copy link
Contributor

leslieab commented Apr 4, 2023

@msmithNI So do the grids from Telerik, AG Grid, and MUI X just throw accessibility errors? All of them have clickable header elements that are not focusable.

@msmithNI
Copy link
Contributor

msmithNI commented Apr 4, 2023

The AG Grid and MUI X grids that you linked do have the same accessibility warnings on their column headers. The Telerik Blazor Grid doesn't, not sure why, maybe the click handlers are being handled at a higher level than the column headers.

It's worth noting that the grids still work fine for end users in Firefox. You only see the accessibility warnings we're talking about if you open the Inspector / Developer Tools, go to the Accessibility tab, and click Check for Issues > All Issues (or Keyboard):
AGGridAccessibility

@leslieab
Copy link
Contributor

leslieab commented Apr 5, 2023

Thanks, I opened the inspector but wasn't sure where to check for those. Is the goal not to have any accessibility errors (and therefore we need to fix this)? Or should we discuss/test this with keyboard navigation/screen reader users to determine whether it's an actual usability issue?

@msmithNI
Copy link
Contributor

msmithNI commented Apr 5, 2023

I don't think we have a hard-and-fast rule about having no accessibility warnings/errors ( @jattasNI @rajsite might have a better answer here), but we try to address them if we can. For this one, I assume the concern is that clickable-but-unfocusable elements wouldn't show up to a screen reader as being interactable.

@jattasNI
Copy link
Contributor

jattasNI commented Apr 6, 2023

Agreed that we try to avoid accessibility warnings but we can live with them if we can convince ourselves that what we're doing is actually accessible.

@leslieab
Copy link
Contributor

leslieab commented Apr 6, 2023

I can't find anything online that suggests there's ever a use case for ignoring this error. The fact that the grid examples I've been using do so is probably an example of what Jim Allan was talking about when he said "people don’t have a lot of expectations [of grids] other than they’re usually coded poorly and they don’t work."

I am going to need to go back and re-examine my wireframes for areas where we are doing this and come up with recommended approaches to add focus back in, which I will not be able to do until next week at the earliest. Is this currently blocking anyone, or can it wait until the week of 17th?

@msmithNI
Copy link
Contributor

msmithNI commented Apr 6, 2023

I think it can wait / is not currently blocking anything. (I'll also be OOO next week and the following week)

@jattasNI jattasNI added the enhancement New feature or request label Apr 11, 2023
@m-akinc m-akinc removed the triage New issue that needs to be reviewed label Apr 11, 2023
mollykreis added a commit that referenced this issue Apr 14, 2023
# Pull Request

## 🤨 Rationale

Adds multi-select support in the table as part of #856 

Functionality included in this change:
- Add selection checkboxes to rows, group rows, and table header when
multi-select is enabled

Functionality explicitly excluded from this change:
- Angular/Blazor support
- Add labels to selection checkboxes. I've added a note in the table
accessibility issue that we need to address this in a similar manner to
addressing it for the expand/collapse button on group rows: #1151
- Add support for multi-selection through CTRL+CLICK and SHIFT+CLICK

## 👩‍💻 Implementation

- Extend `TableRowSelectionMode` to include `multiple`
- Extend `TableRowSelectionState` to include `single`
- Add checkboxes to rows, group rows, and table when the selection mode
was `multiple`.
- I had to wrap the checkboxes in a `gridcell` because a checkbox isn't
an allowable direct child of a `row`. A button also isn't an allowable
direct child of a `row`, so I made the same change to wrap the existing
expand/collapse button on group rows in a `gridcell`
- I ran into issues because the `change` event is fired from the
`nimble-checkbox` when a programmatic change to the value is made.
Therefore, I am programmatically controlling the state of the selection
checkboxes rather than binding to the `checked` and `indeterminate`
properties from templates.
- Some of the TanStack selection code does not work the way we need it
to, particularly around selection + grouping. Therefore, I've written
explicit code to:
- deselect all children of a group when the group row's selection
checkbox becomes unchecked
    - determine the selection state of group rows

## 🧪 Testing

- Added a number of new unit tests
- Manually tested in storybook
- Extended table matrix tests to include all three selection modes
- Added selection modes to the column stories to enable testing
selection with other features such as column sizing and grouping

## ✅ Checklist

<!--- Review the list and put an x in the boxes that apply or ~~strike
through~~ around items that don't (along with an explanation). -->

- [x] I have updated the project documentation to reflect my changes or
determined no changes are needed.
mollykreis added a commit that referenced this issue Apr 20, 2023
# Pull Request

## 🤨 Rationale

Add Angular support for row selection in the table, which is part of
#856.

## 👩‍💻 Implementation

- Add `selectionMode` to the table's directive
- Add `getSelectedRowIds()` and `setSelectedRowIds()` to the table's
directive
- Update the Angular example app to configure a selection mode of
`multiple`
- Update the Angular example app to render with 0 rows in the table
because there are Lighthouse failures otherwise
- This is not an ideal solution (nor a long-term solution). However, we
decided it did not make sense to block adding Angular support for row
selection on Lighthouse failures, particularly when we already have an
issue to track accessibility issues with the table -- #1151

## 🧪 Testing

- Added/ran unit tests
- Verified table worked correctly in example app

## ✅ Checklist

<!--- Review the list and put an x in the boxes that apply or ~~strike
through~~ around items that don't (along with an explanation). -->

- [x] I have updated the project documentation to reflect my changes or
determined no changes are needed.
@msmithNI
Copy link
Contributor

@leslieab I wanted to circle back and see if you had any updates regarding focusability for the interactive parts of the table (clicking column headers for sorting, etc).

I should have interactive sorting implemented at the beginning of next week, so I'm just wondering what the impact would be to that (or interactive grouping / column header menus, which we may start implementing soon). Thanks.

@m-akinc m-akinc moved this from Backlog to In progress in Nimble Design System Priorities Sep 12, 2023
mollykreis added a commit that referenced this issue Sep 20, 2023
# Pull Request

## 🤨 Rationale

Add localized labels and titles to remaining elements within the
nimble-table.

This is part of #1151 

## 👩‍💻 Implementation

Add new label tokens for required strings and use them within the table.

## 🧪 Testing

- Manually tested that the labels show up correctly in the accessibility
tree*
- Manually tested that titles are appropriately shown on elements in
storybook
- Created a branch that re-introduced initial rows in the Angular
example app table and verified that lighthouse accessibility check now
passes.

*As part of this manual check, I found that the labels on our group
header icons don't work as expected due to #1510

## ✅ Checklist

<!--- Review the list and put an x in the boxes that apply or ~~strike
through~~ around items that don't (along with an explanation). -->

- [ ] I have updated the project documentation to reflect my changes or
determined no changes are needed.
@atmgrifter00
Copy link
Contributor Author

Closing this issue by addressing the remaining noted items from the description in the following ways:

  • TableGroupRow has a role or row
  • Expand/collapse button focus behaviors will be addressed as part of Table keyboard interaction #1137
  • Table now has a role of treegrid, and aria-expanded is being set on GroupRows (and Rows) accordingly

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
Development

No branches or pull requests

6 participants