Open Hannah-Frost opened 2 years ago
The aria-label is added because we are using a <Tooltip />
to display description.
SInce their is a lot of element in the header, it could be nice to add a aria-label
on the same level as role="columnheader"
containing by priority the description
, the headerName
, or the field
@m4theushw do you know some specific a11y? I did not found any recommendation saying that role
and aria-label
should be on same level
I only found https://dequeuniversity.com/rules/axe/4.4/aria-allowed-attr?application=AxeChrome
The error makes sense. The div with the title doesn't have role
, so aria-label
is not allowed in it. We could fix this by wrapping the entire column header with the Tooltip
. Since we don't have slots for headers I don't think it's a breaking change.
Duplicates
Latest version
Current behavior π―
When scanning for accessibility issues using axe devtools, DataGrid column headers generate the follow issue:
aria-label attribute is not well supported on a div with no valid role attribute
.It is expecting the generated element
Although the role is declared in a parent div, it may allow for better accessibility to keep it within the same div as the aria-label? Could this instead be an issue with the scanning tool rather than the DataGrid?
Expected behavior π€
The DataGrid should not generate any accessibility issues in the column headers.
Steps to reproduce πΉ
Steps:
Ensures ARIA attributes are allowed for an element's role
will appear.Context π¦
Trying to create a more accessible site. These generated issues from the DataGrid prevent an issue-free accessibility scan.
Your environment π
`npx @mui/envinfo`
``` Chrome Browser System: OS: macOS 11.6 CPU: (12) x64 Intel(R) Core(TM) i7-9750H CPU @ 2.60GHz Memory: 62.06 MB / 16.00 GB Shell: 5.8 - /bin/zsh Binaries: Node: 16.9.1 - /usr/local/bin/node npm: 7.21.1 - /usr/local/bin/npm Managers: CocoaPods: 1.11.2 - /usr/local/bin/pod Homebrew: 3.4.1 - /usr/local/bin/brew pip3: 19.2.3 - /usr/bin/pip3 RubyGems: 3.0.3 - /usr/bin/gem Utilities: Make: 3.81 - /usr/bin/make GCC: 4.2.1 - /usr/bin/gcc Git: 2.30.1 - /usr/bin/git Clang: 12.0.5 - /usr/bin/clang Servers: Apache: 2.4.48 - /usr/sbin/apachectl SDKs: iOS SDK: Platforms: iOS 14.5, DriverKit 20.4, macOS 11.3, tvOS 14.5, watchOS 7.4 IDEs: Nano: 2.0.6 - /usr/bin/nano Vim: 8.2 - /usr/bin/vim Xcode: 12.5.1/12E507 - /usr/bin/xcodebuild Languages: Bash: 3.2.57 - /bin/bash Go: 1.17.8 - /usr/local/bin/go Perl: 5.30.2 - /usr/bin/perl PHP: 7.3.29 - /usr/bin/php Python: 2.7.16 - /usr/bin/python Python3: 3.8.2 - /usr/bin/python3 Ruby: 2.6.3 - /usr/bin/ruby Databases: SQLite: 3.32.3 - /usr/bin/sqlite3 Browsers: Chrome: 100.0.4896.127 Safari: 14.1.2 ```