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

Managed data causes table re-render which breaks edit experience

Open Cyrelc opened this issue 2 years ago • 0 comments

Title

  • bug: Managed data causes table re-render which breaks edit experience

Environment Details

  • react-tabulator version: 0.18.1
  • OS: Ubuntu
  • Node.js version: 14.18.2

Long Description When using a table with managed data and the edit functionality, hitting "tab" to go to the next column - and having it write back to state or a reducer, will cause the table to re-render and lose your position. Is there a better way to go about this, and still have a single source of truth?

Further details - in another implementation I have several tables in the same component, so passing refs is not an option Recording 2022-06-02 at 10 47 13

<ReactTabulator
     columns={packageColumns}
     data={packages}
     events={{
          cellEdited: cell => {
               props.dispatch({type: 'UPDATE_PACKAGES', payload: cell.getTable().getData()})
          }
     }}
/>

Cyrelc avatar Jun 02 '22 16:06 Cyrelc