Skip to content

TreeDataGrid: focus the parent row on ArrowLeft - #4202

Open
nstepien wants to merge 1 commit into
mainfrom
tree-parent-focus
Open

nstepien wants to merge 1 commit into
mainfrom
tree-parent-focus

Conversation

@nstepien

@nstepien nstepien commented Oct 4, 2026

Copy link
Copy Markdown
Collaborator

Pressing ArrowLeft on a collapsed child group row makes its parent group row active, but focus stays on the child row. Other keyboard navigation in DataGrid and clicking a group row both pass { shouldFocus: true }, so this path now does too.

The existing "cell navigation in a treegrid" test already says the parent group should be focused, but it only checked the active class. It now also asserts toHaveFocus(); that assertion fails without the fix.

Also fixes two comments in the row selection handler that described the select and unselect branches the wrong way round.

Verified locally: typecheck, lint, format:check, lint:md, and npm test (529 passed).

🤖 Generated with Claude Code

Pressing ArrowLeft on a collapsed child group made the parent group row
active without moving focus to it, leaving focus on the child row.
Also fix two comments that described the select/unselect branches the
wrong way round.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
@nstepien
nstepien requested a review from amanmahajan7 as a code owner October 4, 2026 23:12
@codecov-commenter

Copy link
Copy Markdown

⚠️ Please install the 'codecov app svg image' to ensure uploads and comments are reliably processed by Codecov.

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 98.30%. Comparing base (b786d20) to head (a279682).
⚠️ Report is 2 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #4202   +/-   ##
=======================================
  Coverage   98.30%   98.30%           
=======================================
  Files          45       45           
  Lines        1943     1943           
  Branches      732      732           
=======================================
  Hits         1910     1910           
  Misses         33       33           
Files with missing lines Coverage Δ
src/TreeDataGrid.tsx 94.41% <100.00%> (ø)
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants