react-selectable icon indicating copy to clipboard operation
react-selectable copied to clipboard

Can it be used with tables?

Open matveychuk opened this issue 5 years ago • 1 comments

I want to use this library to select rows in the table for further actions. I can describe component type for SelectableGroup, for example, tbody. But I can't set component type for SelectableComponent, it's always div. So I have error <tr> cannot appear as a child of <div>. Is there any way to handle it?

matveychuk avatar Sep 10 '19 21:09 matveychuk

Hi! Maybe it's a little bit late for you to solve this but what I've done is to include the SelectableComponent in a td. The code would be ended something like this:

<td>
     <SelectableComponent
            available={ available }
            onChange={() => {}}
            selectableKey={ key }
      >
           {text}
       </SelectableComponent>
</td>

IrisCZ avatar Jan 14 '20 10:01 IrisCZ