defaultTableHeaderRenderer should include the container
See original GitHub issueI’ve been trying to reorder table columns with react-sortable-hoc. This is what I came up with, it almost works well, but I have to drag the headers pretty far in order for them to swap places.
It turns out that this happens because the defaultTableHeaderRenderer
actually returns an array of children, without the container, so I have to add the container myself. However, this means that column header decorated with sortableElement
won’t be a direct child of the header row decorated with sortableContainer
, and that seems to be what causes the problem.
My proposition is to adjust defaultTableHeaderRenderer
to also include the container, rather than only children. This may fix future issues with integrating with other library, not only react-sortable-hoc.
Issue Analytics
- State:
- Created 6 years ago
- Comments:10 (10 by maintainers)
Top GitHub Comments
You’ve probably already seen this but @clauderic added a demo of this with source code.
Thanks for being willing to review it. In the meantime I realized that I’m not very smart 😆 and that the existing API provides enough flexibility.
headerRowRenderer
renderer allows me to make sortable header cells direct descendants of the their sortable container (the header row) via thecolumns
param. Thanks for providing a flexible API! ❤️If anyone reading this would like to see an example, I’ll post it soon to react-sortable-hoc#218.