react-spectrum icon indicating copy to clipboard operation
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

Open dnorth opened this issue 3 years ago • 2 comments

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)

dnorth avatar Jan 12 '22 23:01 dnorth

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?

snowystinger avatar Jan 15 '22 00:01 snowystinger

@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: image 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?

LFDanLu avatar Jan 25 '22 01:01 LFDanLu

closing as stale

snowystinger avatar Mar 18 '24 03:03 snowystinger