Skip to content

feat: default expand action for tableview and treeview#9875

Merged
snowystinger merged 5 commits intomainfrom
default-action-for-expandable-rows
Apr 8, 2026
Merged

feat: default expand action for tableview and treeview#9875
snowystinger merged 5 commits intomainfrom
default-action-for-expandable-rows

Conversation

@snowystinger
Copy link
Copy Markdown
Member

@snowystinger snowystinger commented Apr 3, 2026

Closes RSP Component Milestones (view)

we were originally passing an onAction that did nothing to the Tree story, which is why the row was getting the hover style

I've set it up so that if no onAction is provided, there's a default action on the row which toggles the expanded key. Because it's hooked up through onAction, it also means the disabled behavior is automatically handled, it can't conflict, and it gets the hover state automatically as well

✅ Pull Request Checklist:

  • Included link to corresponding React Spectrum GitHub Issue.
  • Added/updated unit tests and storybook for this change (for new code or code which already has tests).
  • Filled out test instructions.
  • Updated documentation (if it already exists for this component).
  • Looked at the Accessibility Practices for this feature - Aria Practices

📝 Test Instructions:

Go to the Tree/Table stories in S2, try combinations of controls
onAction: on/off
disabledBehavior: all/selection
selectionMode: multiple/single/none

Make sure that hover works on the row and you can toggle expansion from anywhere on the row, not just the chevron

Note, having an onAction prevents this, and disabledBehavior all

🧢 Your Project:

@rspbot
Copy link
Copy Markdown

rspbot commented Apr 3, 2026

Co-authored-by: Reid Barber <reid@reidbarber.com>
@rspbot
Copy link
Copy Markdown

rspbot commented Apr 7, 2026

@snowystinger snowystinger added this pull request to the merge queue Apr 8, 2026
Merged via the queue into main with commit bef549d Apr 8, 2026
29 checks passed
@snowystinger snowystinger deleted the default-action-for-expandable-rows branch April 8, 2026 19:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants