You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[EuiTable][a11y] select row Checkbox elements must have correct labels #7542
We've received reports of a few accessibility (a11y) issues concerning the table component and the select/deselect row functionality. Could we consider adding an aria-label attribute to address these checkbox-related concerns?
@1Copenut Does this match your audit/reviews? Also, does a generic "check this row" label help all that much, or do we need to be more specific or individual in the screen reader text we offer?
@cee-chen Yes, I've been seeing this in audits for Security Solution this past week. I think the label could be as simple as Check | Uncheck row 1 if that's the only functionality for the box. It answers the question of intent and meets the WCAG success criteria.
OK hold on, so you do need per-row differentiation? That's not as straightforward as it seems because row numbers are affected by pagination and sorting.
For example, is the first row on the second page (with 20 items per page) considered "Row 1" or is it considered "Row 21"?
@cee-chen@1Copenut I think it would be ideal if we could calculate rows starting from 0 without linking to pages, filters, sorting, and other operations affecting the number of elements in the visible table area. However, I understand that this might be a bit more complex than just using the index of the data-item in the incoming data array.
On the other hand, any solution you provide will address accessibility issues, so let's choose the option that is simpler for implementing
@cee-chen && @alexwizp This is a tough question to get the right answer for without user research tbh. I can see both arguments:
We calculate the unique row labels from 0 and attach to each checkbox, regardless of filtering, pagination, etc. This means a user might hear labels for checking/unchecking a row that are non-sequential, IE rows 1, 7, 10, 12, and 15. That may be confusing but it may not. We don't have enough information to say definitively.
We assume the row labels are re-calculated as users paginate, filter, etc. If we're showing five rows, we have five sequential labels that are re-rendered from 0, IE rows 0, 1, 2, 3, 4. We do not concern ourselves with the actual row index. This might be okay but again, not enough information.
I feel like data grids are information dense and meant to be filtered, flipped, sorted. Maybe a way forward is to own that we're not counting indexes and just be clear with the labeling. What if our label was
@1Copenut Are there other accessible table libraries out there with selection functionality that we can shamelessly copy take a leaf from? I'd be really surprised if we were the only design system/library to encounter this problem.
I have a couple of good ideas based on how Adobe is creating accessible labels in their useGridList hook. Basically they're concatenating two accessible labels by referencing IDs in an aria-labelledby attribute. I think this could be a way forward, and will have it on the docket to discuss next week in the Grooming meeting.
I'm going to close this issue because it's necessary to create accessible labels by picking the best column from data being presented, rather than hardcoding it into design system components.
Activity
cee-chen commentedon Feb 23, 2024
@1Copenut Does this match your audit/reviews? Also, does a generic "check this row" label help all that much, or do we need to be more specific or individual in the screen reader text we offer?
1Copenut commentedon Feb 23, 2024
@cee-chen Yes, I've been seeing this in audits for Security Solution this past week. I think the label could be as simple as
Check | Uncheck row 1if that's the only functionality for the box. It answers the question of intent and meets the WCAG success criteria.cee-chen commentedon Feb 23, 2024
OK hold on, so you do need per-row differentiation? That's not as straightforward as it seems because row numbers are affected by pagination and sorting.
For example, is the first row on the second page (with 20 items per page) considered "Row 1" or is it considered "Row 21"?
alexwizp commentedon Feb 28, 2024
@cee-chen @1Copenut I think it would be ideal if we could calculate rows starting from
0without linking to pages, filters, sorting, and other operations affecting the number of elements in the visible table area. However, I understand that this might be a bit more complex than just using theindexof thedata-itemin the incoming data array.On the other hand, any solution you provide will address accessibility issues, so let's choose the option that is simpler for implementing
1Copenut commentedon Mar 4, 2024
@cee-chen && @alexwizp This is a tough question to get the right answer for without user research tbh. I can see both arguments:
0and attach to each checkbox, regardless of filtering, pagination, etc. This means a user might hear labels for checking/unchecking a row that are non-sequential, IE rows 1, 7, 10, 12, and 15. That may be confusing but it may not. We don't have enough information to say definitively.0, IE rows 0, 1, 2, 3, 4. We do not concern ourselves with the actual row index. This might be okay but again, not enough information.I feel like data grids are information dense and meant to be filtered, flipped, sorted. Maybe a way forward is to own that we're not counting indexes and just be clear with the labeling. What if our label was
cee-chen commentedon Mar 4, 2024
@1Copenut Are there other accessible table libraries out there with selection functionality that we can
shamelessly copytake a leaf from? I'd be really surprised if we were the only design system/library to encounter this problem.1Copenut commentedon Mar 5, 2024
I have a couple of good ideas based on how Adobe is creating accessible labels in their useGridList hook. Basically they're concatenating two accessible labels by referencing IDs in an
aria-labelledbyattribute. I think this could be a way forward, and will have it on the docket to discuss next week in the Grooming meeting.1Copenut commentedon Mar 13, 2024
@alexwizp I took another look at this over the last couple of days. EUI provides a way for consumers to create accessible checkbox labels in the data grid components. I updated the description and proposed solution in https://github.com/elastic/security-team/issues/8577.
I'm going to close this issue because it's necessary to create accessible labels by picking the best column from data being presented, rather than hardcoding it into design system components.