question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

defaultTableHeaderRenderer should include the container

See original GitHub issue

I’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:closed
  • Created 6 years ago
  • Comments:10 (10 by maintainers)

github_iconTop GitHub Comments

2reactions
bvaughncommented, Sep 6, 2017

You’ve probably already seen this but @clauderic added a demo of this with source code.

1reaction
silvenoncommented, Sep 5, 2017

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 the columns 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.

Read more comments on GitHub >

github_iconTop Results From Across the Web

clauderic/react-sortable-hoc - Gitter
I have mine setup to key={index+value}. _. Szőke Szabolcs ... The first children of the SortableContainer are the columns wrapped in a SortableElement....
Read more >
Class DefaultTableHeaderRenderer - SAS Support
Returns an Insets object containing this component's inset values. The passed-in Insets object will be reused if possible. Calling methods cannot assume that ......
Read more >
How to use Synthetica Addons - java - Stack Overflow
I need to use specially JYTable , but I fail several times. ... setVisible(true); } /** * Create components and add them to...
Read more >
types/react-virtualized@9.21.21 - jsDocs.io
pnpm add @types/react-virtualized ... Child component should not be declared as a child but should rather be ... autoContainerWidth: false;.
Read more >
AbstractComponent (Lanterna 3.0.4 API)
Called by the GUI system when you add a component to a container; DO NOT CALL THIS YOURSELF! · This method is called...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found