Repository navigation
Toggle groups with Enter on the group row - #4274
Draft
amanmahajan7 wants to merge 1 commit into
Draft
amanmahajan7 wants to merge 1 commit into
amanmahajan7 wants to merge 1 commit into
Conversation
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Moves the group toggle's keyboard handling from the toggle's content to
TreeDataGrid, so Enter behaves the same however focus reached the group row. Follows up on the review of #4246, which first tried turning the toggle into a<button>.Problem
ToggleGrouprendered a focusable<span>that toggled the group on Enter. Whether Enter worked depended on which element had focus:renderGroupCellrenderers had to handle the key themselves.Changes
TreeDataGrid: Enter toggles the group when the group row is focused, or when the cell that toggles the group on click is active. Other cells of the group row ignore it, the same as for clicks.ToggleGroup: no longer focusable and no longer handles keys. Itsoutline: nonestyle, which only applied to the focused span, is removed. Therdg-group-cell-contentclass stays.TreeDataGridkeyboard list.This matches the WAI-ARIA treegrid pattern, where focus stays on rows and cells, and the row's
aria-expandedexposes the state. Space is unchanged: it isn't required by the pattern, and Shift+Space selects rows.Possible impact: a custom
renderGroupCellrenderer that also toggles on Enter would now toggle twice.RenderGroupCellContentPropsstill passestabIndex, so focusable custom content keeps working.Testing
vp check,vp run typecheckandvp run eslintpass.TreeDataGrid.test.tsxnow covers Enter on the focused row, Enter after moving away and back with the arrow keys, Enter on the group cell, and Enter on another cell of the group row. It fails onmainat the first Enter.TreeDataGridandcolumn/groupingtests pass in Chromium, Firefox and WebKit.🤖 Generated with Claude Code