-
Notifications
You must be signed in to change notification settings - Fork 130
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
Add sortedRow and sortDirection to Table Props in order to give the possibility to define initial sort order #1377
Comments
Just to clarify: is this mostly intended as a workaround for #1291, where is we move the sorting logic from internal state to props, we could avoid the re-renders? Or are there other use cases for it? If this is to solve the re-renders, I have some doubts since this essentially makes the If there's other use cases to the new props, I think this would be a very welcome addition, and in this case I just wanted to add a couple of thoughts:
|
Thank you @robinmetral for raising this question. This is not related to #1291 but rather a new feature thats makes it possible to either The second one is what would fix a bug in the item catalog where the sort direction gets lost on opening the variant list because opening the variant list changes the state in the parent component which then re renders the table with the initial "no sorting". I think this is just a minor change (and i guess non breaking) and i have the change already ready in a branch. I will submit a pull request this makes it probably easier to understand what this change is about. |
Ah makes sense, thank you for the extra context! Thanks for the PR, will review now 🙂 |
Component to amend
Table
Context
It would really help if it would be possible to specify the sortDirection and sortedRow as Table props. This would help i in case an action of the table changes the State of the outer Component and results in re rendering the Table component. When the Table was sorted then it loses the sortOrder and renders with sortOrder = undefined.
I would be happy to provide a pull request.
The text was updated successfully, but these errors were encountered: