Skip to content

feat: enhance listdata selection methods #8656

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged

Conversation

rbuzatto
Copy link
Contributor

Closes #7666

✅ 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:

🧢 Your Project:

@rbuzatto
Copy link
Contributor Author

  • added validation for including/removing valid keys only
  • checked if final Selection equals to all valid item keys to return 'all'

@rbuzatto rbuzatto closed this Jul 30, 2025
@rbuzatto rbuzatto reopened this Jul 30, 2025
@rbuzatto
Copy link
Contributor Author

rbuzatto commented Jul 30, 2025

somewhat related; current setSelectedKeys implementation only forwards selectedKeys arguments. there are some validation here that could be eventually be helpful, (e.g. check if selection is an array of all keys set as 'all' instead of the provided array) I could be adding here too if it makes sense

Copy link
Member

@snowystinger snowystinger left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for starting this PR, just a couple of notes to start

snowystinger
snowystinger previously approved these changes Aug 1, 2025
Copy link
Member

@LFDanLu LFDanLu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me, thanks for the contribution! Pushed a couple of additional test cases, hope you don't mind

@rbuzatto
Copy link
Contributor Author

rbuzatto commented Aug 6, 2025

Looks good to me, thanks for the contribution! Pushed a couple of additional test cases, hope you don't mind

thanks for including these test, they are good additions.

@snowystinger snowystinger added this pull request to the merge queue Aug 6, 2025
Merged via the queue into adobe:main with commit 49faf4a Aug 6, 2025
32 checks passed
@rbuzatto rbuzatto deleted the enhance-listdata-selection-methods branch August 7, 2025 02:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Feature request] ListData selection management convenience methods
3 participants