Skip to content

[DataGrid] Add ariaV7 experimental flag#9496

Merged
cherniavskii merged 12 commits intomui:masterfrom
cherniavskii:aria-v7
Jul 31, 2023
Merged

[DataGrid] Add ariaV7 experimental flag#9496
cherniavskii merged 12 commits intomui:masterfrom
cherniavskii:aria-v7

Conversation

@cherniavskii
Copy link
Member

@cherniavskii cherniavskii commented Jun 27, 2023

Fixes #9403
Fixes #8525
Fixes #8624

Using an experimental flag allows us to:

  1. Avoid breaking changes
  2. Fix some of the reported accessibility issues while preparing for v7

Preview: https://deploy-preview-9496--material-ui-x.netlify.app/x/react-data-grid/accessibility/#accessibility-changes-in-v7

TODO:

@mui-bot
Copy link

mui-bot commented Jun 27, 2023

Netlify deploy preview

Netlify deploy preview: https://deploy-preview-9496--material-ui-x.netlify.app/

Updated pages

These are the results for the performance tests:

Test case Unit Min Max Median Mean σ
Filter 100k rows ms 315.4 423.2 409.2 377.48 50.287
Sort 100k rows ms 416.8 995.1 791.8 728.86 219.836
Select 100k rows ms 156.6 252 182.6 189.9 32.984
Deselect 100k rows ms 102.9 209.9 179 158.22 42.872

Generated by 🚫 dangerJS against eb9c68e

@cherniavskii cherniavskii requested review from m4theushw and romgrk June 28, 2023 15:10
@oliviertassinari
Copy link
Member

oliviertassinari commented Jul 15, 2023

As far as I understand it, this PR also closes #8624. We have 3 duplicate issues (#9403, #8525, #8624).

const pinnedRowsCount = useGridSelector(apiRef, gridPinnedRowsCountSelector);

return {
role: 'grid',
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Per https://www.w3.org/WAI/ARIA/apg/patterns/treegrid/ we might have the wrong role when treeData={true}

Suggested change
role: 'grid',
role: rootProps.treeData ? 'treegrid' : 'grid',

AG Grid seems to make it a treegrid in all the cases, e.g. https://ag-grid.com/react-data-grid/column-definitions/ which feels broken.

Copy link
Member

@oliviertassinari oliviertassinari Jul 15, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

On a related note, I would argue that role="cell" is wrong too, it should be role="gridcell". Two sources that points in this direction:

Screenshot 2023-07-15 at 18 47 57

https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Roles/cell_role

Screenshot 2023-07-15 at 18 48 58

https://www.w3.org/WAI/ARIA/apg/patterns/grid/

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we might have the wrong role when treeData={true}

Updated to use treegrid role when treeData={true} and ariaV7 experimental flag is enabled to avoid breaking changes 👍

I would argue that role="cell" is wrong too, it should be role="gridcell"

Yup, done! I've also fixed a few accessibility tree issues and tested with VoiceOver - it's more usable now (both with ariaV7 flag and without it) 👍

@cherniavskii cherniavskii marked this pull request as ready for review July 24, 2023 09:09
@cherniavskii cherniavskii enabled auto-merge (squash) July 28, 2023 16:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

accessibility a11y scope: data grid Changes related to the data grid.

Projects

None yet

4 participants