-
Notifications
You must be signed in to change notification settings - Fork 860
[EuiDataGrid] Remove aria-hidden from column actions button
#9166
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
[EuiDataGrid] Remove aria-hidden from column actions button
#9166
Conversation
- this removes the need to use aria-hidden on the actions button which violates a11y guidelines
…instead of width=0 - width=0 otherwise results in screen readers not finding the DOM element anymore as it's not available and the a11y tree not updated anymore due to the remove aria-hidden
| max-inline-size: 24px; | ||
| ${header.hideActions} & { | ||
| ${logicalCSS('width', 0)} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The transition to width=0 would result in screen readers not being able to detect the element, even after the transition back to full width. Likely the CSS transition doesn't trigger an update on the a11y tree, meaning the element is initially not present and stays that way.
The proposed workaround uses transform instead and uses negative margins to ensure the element collapses within the flex container to ensure parity with the existing show/hide behavior for header cells.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Cool idea! 👍🏻
e622987 to
f6988e3
Compare
alexwizp
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The changes look correct! Thank you.
packages/eui/src/components/datagrid/body/cell/data_grid_cell.styles.spec.tsx
Outdated
Show resolved
Hide resolved
...nce/chrome_desktop_Tabular_Content_EuiDataGrid_toolbarVisibility_prop_Keyboard_Shortcuts.png
Show resolved
Hide resolved
packages/eui/src/components/datagrid/body/header/data_grid_header_cell.styles.ts
Outdated
Show resolved
Hide resolved
packages/eui/src/components/datagrid/body/header/column_actions.tsx
Outdated
Show resolved
Hide resolved
weronikaolejniczak
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Overall, looks good 👏🏻 I just left a couple of nits. Thanks for refactoring the code.
Testing
Seems to be working as expected 👍🏻
Win + Edge + NVDA
Kapture.2025-11-03.at.11.10.02.mp4
MacOS + Safari + VoiceOver
Kapture.2025-11-03.at.11.12.19.mp4
8a9775a to
e69ac90
Compare
weronikaolejniczak
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM! 🟢 Thanks for applying my suggestions, @mgadewoll!
💚 Build SucceededHistory
cc @mgadewoll |
💚 Build Succeeded
History
cc @mgadewoll |
…y/apps/dashboard_panel_options·ts - Dashboard panel options a11y tests dashboard panel - clone panel (#241259) Closes: #147667 **Depends on** elastic/eui#9166 Flaky tests have passed ✅
…y/apps/dashboard_panel_options·ts - Dashboard panel options a11y tests dashboard panel - clone panel (elastic#241259) Closes: elastic#147667 **Depends on** elastic/eui#9166 Flaky tests have passed ✅
Closes: #153597 **Depends on** elastic/eui#9166 Flaky tests have passed ✅
…y/apps/dashboard_panel_options·ts - Dashboard panel options a11y tests dashboard panel - clone panel (elastic#241259) Closes: elastic#147667 **Depends on** elastic/eui#9166 Flaky tests have passed ✅
Closes: elastic#153597 **Depends on** elastic/eui#9166 Flaky tests have passed ✅
Summary
This PR refactors
EuiDataGridcolumns headers to remove the need for usingaria-hiddenon the actions button as this causes axe core warnings that require Kibana to skip tests:Warning: Do not use aria-hidden="true" on focusable elements.The
aria-hiddenwas originally added to prevent the nested action button from being read with the content for the case when the cell has nested content and nodisplayAsTextis passed (which is used as text-only label for the content).Background information
The previous state of the component would result in the following possible output for screen readers, depending on what information is passed to the column:
Note
ℹ️ After the update scenario 3 is removed. The actions button will never be read on focusing a nested cell. It's only read when focusing the actions button directly when entering a nested cell.
displayAsTextdisplayAsTextdisplayAsTextnameand the custom content (e.g. info tooltiparia-label)displayAsTextand withoutaria-hiddenon the actions buttonreads the
name, the custom content (e.g. info tooltiparia-label) and the actions buttonaria-labelChanges
aria-labelledbyto link the cell content to be read on focus of the cell wrapper to prevent the action button from being readwidth=0totransformaswidth=0results in the element not being perceivable for screen readers (it worked before because the toggling ofaria-hiddenon the button would force an accessibility tree update)Screen.Recording.2025-10-31.at.14.45.03.mov
Why are we making this change?
aria-hiddenon focusable elements🧰 Maintenance/Code health: Prevent having to skip FTR tests in Kibana due to axe core warnings.
Screenshots #
Screen.Recording.2025-11-01.at.11.26.46.mov
Screen.Recording.2025-10-31.at.14.45.03.mov
Screen.Recording.2025-11-01.at.11.27.46.mov
Screen.Recording.2025-11-01.at.11.28.46.mov
Impact to users
🟢 No updates are required on consumer side.
ℹ️ The DOM changes might require snapshot updates.
QA
🔗 EuiDataGrid storybook
General checklist
@defaultif default values are missing) and playground toggles