react-data-table-component icon indicating copy to clipboard operation
react-data-table-component copied to clipboard

reorder property does not apply to cells

Open Christophe-Sibille opened this issue 2 years ago • 1 comments

Issue Check list

  • [x] Agree to the Code of Conduct
  • [x] Read the README
  • [x] You are using React 16.8.0+
  • [x] You installed styled-components
  • [x] Include relevant code or preferably a code sandbox

Sample of the code

'use client'; import Image from 'next/image' import styles from './page.module.css' import DataTable from 'react-data-table-component'

export default function Home() {

const columns=[ { name:'Title', reorder:false, sortable:false, selectableRows:false, selector:row => row.title }, { name:'Description', reorder:false, sortable:false, selectableRows:false, selector:row => row.description } ];

const data=[ { id:1, title:'Title 1', description: 'Description 1' }, { id:2, title:'Title 2', description: 'Description 2' } ];

return ( <DataTable columns={columns} data={data} onColumnOrderChange={cols => console.log(cols)} ></DataTable>

) }

Describe the bug

I would like to disable the reorder feature on dataTable component. So i try to use the reorder property on all the columns available inside the dataTable.

When i clicked on the header of the column the property is correctly applied but I'm able to reorder the cells themselves. So the property does no apply to the cells.

To Reproduce

Steps to reproduce the behavior:

  1. Go to '...'
  2. Click on '....'
  3. Scroll down to '....'
  4. See error

Expected behavior

A clear and concise description of what you expected to happen.

Code Sandbox, Screenshots, or Relevant Code

Please include a codesandbox to help expedite troublshooting.

https://codesandbox.io/embed/react-data-table-sandbox-ccyuu

Otherwise, add screenshots and/or complete sample code to help explain your problem.

Versions (please complete the following information)

  • React (RDT requires 16.8.0+)
  • Styled Components : 5.3.3.
  • OS: Windows 11
  • Browser [e.g. chrome, safari, firefox]

Christophe-Sibille avatar Sep 20 '23 13:09 Christophe-Sibille

Same request here. I didn't found any smart solution. Help/support is welcome

clemich avatar Nov 27 '23 08:11 clemich