From 329f53e481c82b333b8b4754171508bbe7022069 Mon Sep 17 00:00:00 2001 From: Jakub Wojdziak Date: Wed, 30 Sep 2026 00:14:06 +0200 Subject: [PATCH] feat: enable expandable rows for detail panels in flat data --- .../src/mantine-react-table/hooks/useMRT_TableOptions.ts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/examples/react/mantine-react-table/src/mantine-react-table/hooks/useMRT_TableOptions.ts b/examples/react/mantine-react-table/src/mantine-react-table/hooks/useMRT_TableOptions.ts index e45452e80c..24d5ba3163 100644 --- a/examples/react/mantine-react-table/src/mantine-react-table/hooks/useMRT_TableOptions.ts +++ b/examples/react/mantine-react-table/src/mantine-react-table/hooks/useMRT_TableOptions.ts @@ -251,6 +251,10 @@ export const useMRT_TableOptions: ( } : {}), }, + // v9's `row.toggleExpanded()` is a no-op unless `getCanExpand()` is true, + // which by default requires subRows. Every row with a detail panel must be + // expandable, even in flat data. A user-supplied `getRowCanExpand` wins. + getRowCanExpand: rest.renderDetailPanel ? () => true : undefined, getSubRows: (row: TData) => (row as any)?.subRows, icons, layoutMode,