react-spectrum
react-spectrum copied to clipboard
Fix bug where sort info doesnt exist because a sort is applied on a column that is not passed into useTable
Closes
✅ 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:
- Create a TableView where the sortDescription relies on a column that does not exist (in this case it is a hidden column, so it is not passed in from @quarry/inventory)
🧢 Your Project:
Adobe/Quarry/Inventory/Analytics (hidden columns)
Hey! Thanks for this, while I'm sure that you've found a bug. Would you mind providing a codesandbox demonstrating the issue? or a test proving that it works?
@jluyau brought this one up with me actually, here is a modified sandbox from our discussion: https://codesandbox.io/s/jovial-orla-uig0f?file=/src/App.js. The issue is that the sort description can end up being populated without an actual column name like so:
if the user provides a React Node to the Column element without specifying a
textValue
on the column.
Perhaps we should also have a console warning in Column/Row/etc like Item does: https://github.com/adobe/react-spectrum/blob/main/packages/@react-stately/collections/src/Item.ts#L28-L30?
closing as stale