Skip to content

feat: default expand action for tableview and treeview#9875

Open
snowystinger wants to merge 4 commits intomainfrom
default-action-for-expandable-rows
Open

feat: default expand action for tableview and treeview#9875
snowystinger wants to merge 4 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

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.

2 participants