feat(ebay-table): support column sorting
Description
Context
References
Screenshots
https://github.com/user-attachments/assets/f57d8a50-bf51-4e0c-9103-5d2a9deb244c
🦋 Changeset detected
Latest commit: c613ef65ca26520380ad8dc3cdb993db6bace7ff
The changes in this PR will be included in the next version bump.
This PR includes changesets to release 1 package
| Name | Type |
|---|---|
| @ebay/ebayui-core | Minor |
Not sure what this means? Click here to learn what changesets are.
Click here if you're a maintainer who wants to add another changeset to this PR
Clicking sort doesn't appear to be re-rendering the table for me:
Clicking sort doesn't appear to be re-rendering the table for me:
![]()
![]()
![]()
This is something we discussed with bill We only emit an event and let teams to do the sort on their end. We don't want to include a janky sorting logic that 99% of the time wont be used. We only swap the sort icon. I believe this is mentioned in the on-sort event docs.
@ianmcburnie Also we don't have reference to input data, so theoretically we cannot sort rows. We can add explanatory code in examples but that would make example file pretty big.
So this is more related to Skin (@ArtBlue), but I'm still not convinced we should be using aria-pressed on the sort buttons for ascending and descending state:
Toggle buttons require a full press-and-release cycle to change their value. Pressing and releasing it once changes the value to true. If it's pressed and released again, the value changes back to false.
We do not meet the criteria for this press and release cycle because we have more than two values. We could possibly use a value of mixed, but I'm not sure there's any real benefit in that.
Source: https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Attributes/aria-pressed
Also, the APG pattern is not using aria-pressed: https://www.w3.org/WAI/ARIA/apg/patterns/table/examples/sortable-table/
One issue Im seeing on the sort is that when it is toggled to none, it should reset the list to the initial state. We might need to clone the list in that case and then set it to the initial clone when sorting is none.
One issue Im seeing on the sort is that when it is toggled to none, it should reset the list to the initial state. We might need to clone the list in that case and then set it to the initial clone when sorting is none.
Fixed, good catch.