File tree 1 file changed +3
-3
lines changed
packages/x-data-grid-pro/src/hooks/features/detailPanel
1 file changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -89,7 +89,6 @@ export const useGridDetailPanel = (
89
89
| 'onDetailPanelExpandedRowIdsChange'
90
90
> ,
91
91
) : void => {
92
- const expandedRowIds = useGridSelector ( apiRef , gridDetailPanelExpandedRowIdsSelector ) ;
93
92
const contentCache = useGridSelector ( apiRef , gridDetailPanelExpandedRowsContentCacheSelector ) ;
94
93
95
94
const handleCellClick = React . useCallback < GridEventListener < 'cellClick' > > (
@@ -283,7 +282,8 @@ export const useGridDetailPanel = (
283
282
284
283
const addDetailHeight = React . useCallback < GridPipeProcessor < 'rowHeight' > > (
285
284
( initialValue , row ) => {
286
- if ( ! expandedRowIds || expandedRowIds . size === 0 || ! expandedRowIds . has ( row . id ) ) {
285
+ const expandedRowIds = gridDetailPanelExpandedRowIdsSelector ( apiRef ) ;
286
+ if ( ! expandedRowIds || ! expandedRowIds . has ( row . id ) ) {
287
287
initialValue . detail = 0 ;
288
288
return initialValue ;
289
289
}
@@ -295,7 +295,7 @@ export const useGridDetailPanel = (
295
295
initialValue . detail = heightCache [ row . id ] . height ?? 0 ; // Fallback to zero because the cache might not be ready yet (for example page was changed)
296
296
return initialValue ;
297
297
} ,
298
- [ apiRef , expandedRowIds , updateCachesIfNeeded ] ,
298
+ [ apiRef , updateCachesIfNeeded ] ,
299
299
) ;
300
300
301
301
const enabled = props . getDetailPanelContent !== undefined ;
You can’t perform that action at this time.
0 commit comments