You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
renderDetailPanel shows a detail panel when the rows array is empty #525
If there are no rows passed into the table the expand row button is shown and the component rendered using the renderDetailPanel will still be shown if the expand row button is clicked
Additionally when setting test-ids for each row as per below: mantineTableBodyRowProps: { "data-testid": "a-test-id" },
In previous versions, if there were no rows, and the "No records to display" text was shown, checking for this testid would show that there are no rows. In version 2.0.0-beta.9, it shows there are 2 rows, 1 containing the "No records to display" text and the other being the detail panel
Minimal, Reproducible Example - (Optional, but Recommended)
Do you intend to try to help solve this bug with your own PR?
No, because I do not have time to dig into it
Terms
I understand that if my bug cannot be reliably reproduced in a debuggable environment, it will probably not be fixed and this issue may even be closed.
if (
!row.original || // covers null and undefined
(typeof row.original === "object" &&
Object.keys(row.original).length === 0)
) {
return;
}
They have note that renderDetailPanel will also render for empty row
Activity
masterbater commentedon Jun 17, 2025
Just add this condition
They have note that renderDetailPanel will also render for empty row
mantine-react-table/packages/mantine-react-table/stories/features/EmptyRow.stories.tsx
Line 95 in 07ee2ef
FenderStrat85 commentedon Jun 17, 2025
Nice one, thank you!