primereact icon indicating copy to clipboard operation
primereact copied to clipboard

A TypeError is encountered when attempting to collapse any row after using the “Expand All” button in a table with expanded rows and row group mode

Open Vseslavr opened this issue 8 months ago • 0 comments

Describe the bug

A TypeError is encountered when attempting to collapse any row after using the “Expand All” button in a table with expanded rows and row group mode. The error occurs in the primereact_datatable.js file.

Reproducer

https://stackblitz.com/edit/q52q3u?file=src%2FApp.jsx

PrimeReact version

10.6.6

React version

18.x

Language

ALL

Build / Runtime

Next.js

Browser(s)

Chrome 126

Steps to reproduce the behavior

  1. Use a DataTable with expanded rows and row group mode as per the provided code example.
  2. Click on the “Expand All” button to expand all rows.
  3. Try to collapse any of the expanded rows.
  4. Observe the console error.

primereact_datatable.js?v=7b9c8279:8812 Uncaught TypeError: (collection || []).findIndex is not a function at findIndex2 (primereact_datatable…?v=7b9c8279:8812:31) at Object.onRowToggle2 [as onRowToggle] (primereact_datatable…?v=7b9c8279:9254:30) at onRowToggle2 (primereact_datatable…?v=7b9c8279:7674:11) at HTMLUnknownElement.callCallback2 (chunk-3AYKYWEJ.js?v=c0490a77:3674:22) at Object.invokeGuardedCallbackDev (chunk-3AYKYWEJ.js?v=c0490a77:3699:24) at invokeGuardedCallback (chunk-3AYKYWEJ.js?v=c0490a77:3733:39) at invokeGuardedCallbackAndCatchFirstError (chunk-3AYKYWEJ.js?v=c0490a77:3736:33) at executeDispatch (chunk-3AYKYWEJ.js?v=c0490a77:7014:11) at processDispatchQueueItemsInOrder (chunk-3AYKYWEJ.js?v=c0490a77:7034:15) at processDispatchQueue (chunk-3AYKYWEJ.js?v=c0490a77:7043:13)

Знімок екрана 2024-06-19 о 14 22 48

Expected behavior

Rows should be able to collapse without any errors.

Vseslavr avatar Jun 19 '24 11:06 Vseslavr