Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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 #6771

Open
Vseslavr opened this issue Jun 19, 2024 · 0 comments
Labels
Type: Bug Issue contains a defect related to a specific component.

Comments

@Vseslavr
Copy link

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 Vseslavr added the Status: Needs Triage Issue will be reviewed by Core Team and a relevant label will be added as soon as possible label Jun 19, 2024
@melloware melloware added Type: Bug Issue contains a defect related to a specific component. and removed Status: Needs Triage Issue will be reviewed by Core Team and a relevant label will be added as soon as possible labels Jun 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: Bug Issue contains a defect related to a specific component.
Projects
None yet
Development

No branches or pull requests

2 participants