Skip to content

feat(react): add keyboard-accessible row click to DataTable - #491

Merged
grandmaester merged 1 commit into
feat/my-org-ea-branchfrom
feat/data-table-row-click
Aug 21, 2026
Merged

feat(react): add keyboard-accessible row click to DataTable#491
grandmaester merged 1 commit into
feat/my-org-ea-branchfrom
feat/data-table-row-click

Conversation

@grandmaester

@grandmaester grandmaester commented Aug 21, 2026

Copy link
Copy Markdown
Contributor

Summary

Ports the row-click behaviour from the UDS data table into our shared DataTable, so rows are reachable by keyboard and not just by pointer.

Why

DataTable already supported onRowClick, but only as a bare onClick on <tr>: no tabIndex, no role, no key handling. That is invisible to keyboard and screen-reader users.

It matters now because of permission gating. Once a row's action menu is hidden for users without mutating permissions, row-click becomes their only route to a details view. Without keyboard support, those users cannot reach member, invitation, domain or provider details at all.

What

Behaviour Detail
Focusable rows tabIndex={0} and an accessible label when onRowClick is set
Keyboard activation Enter or Space, only when the row itself is focused
Focus ring focus-visible ring so keyboard focus is visible
Control guard Clicks on an interactive descendant (menu trigger, checkbox, switch, link) no longer navigate

The guard uses UDS's focusable-element check rather than relying on every cell remembering to stop propagation:

const FOCUSABLE_SELECTOR =
  'a[href], button, input, select, textarea, [tabindex]:not([tabindex="-1"]), [contenteditable="true"]';

const focusable = (event.target as HTMLElement).closest(FOCUSABLE_SELECTOR);
if (focusable && focusable !== event.currentTarget) return;

Packages

  • packages/core — adds the view_row label to en-US, fr and ja
  • packages/reactDataTable
  • examples

Testing

Tested after integrating with Member Table:
image

image
  • react typecheck clean, 1840 tests / 112 files pass

  • core typecheck clean, 1109 tests pass

  • eslint and prettier clean

  • This change adds unit test coverage

  • Tested for both SPA and RWA flows, all example apps working

  • All existing and new tests complete without errors

Checklist

  • Breaking change
  • Requires docs update
  • Backward compatible

Contributing

@coderabbitai

coderabbitai Bot commented Aug 21, 2026

Copy link
Copy Markdown
Contributor

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 3d5e69ba-a6c3-4433-a2a8-71c93806c23e

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@grandmaester grandmaester self-assigned this Aug 21, 2026
@grandmaester grandmaester added the enhancement New feature or request label Aug 21, 2026
@grandmaester
grandmaester merged commit 05ba87f into feat/my-org-ea-branch Aug 21, 2026
2 checks passed
@grandmaester
grandmaester deleted the feat/data-table-row-click branch August 21, 2026 09:09
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

None yet

Development

Successfully merging this pull request may close these issues.

2 participants