File tree 1 file changed +4
-3
lines changed
packages/x-data-grid-pro/src/hooks/features/detailPanel
1 file changed +4
-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' > > (
@@ -176,6 +175,7 @@ export const useGridDetailPanel = (
176
175
} ,
177
176
} ;
178
177
} ) ;
178
+ apiRef . current . requestPipeProcessorsApplication ( 'rowHeight' ) ;
179
179
} ,
180
180
[ apiRef ] ,
181
181
) ;
@@ -283,7 +283,8 @@ export const useGridDetailPanel = (
283
283
284
284
const addDetailHeight = React . useCallback < GridPipeProcessor < 'rowHeight' > > (
285
285
( initialValue , row ) => {
286
- if ( ! expandedRowIds || expandedRowIds . size === 0 || ! expandedRowIds . has ( row . id ) ) {
286
+ const expandedRowIds = gridDetailPanelExpandedRowIdsSelector ( apiRef ) ;
287
+ if ( ! expandedRowIds || ! expandedRowIds . has ( row . id ) ) {
287
288
initialValue . detail = 0 ;
288
289
return initialValue ;
289
290
}
@@ -295,7 +296,7 @@ export const useGridDetailPanel = (
295
296
initialValue . detail = heightCache [ row . id ] . height ?? 0 ; // Fallback to zero because the cache might not be ready yet (for example page was changed)
296
297
return initialValue ;
297
298
} ,
298
- [ apiRef , expandedRowIds , updateCachesIfNeeded ] ,
299
+ [ apiRef , updateCachesIfNeeded ] ,
299
300
) ;
300
301
301
302
const enabled = props . getDetailPanelContent !== undefined ;
You can’t perform that action at this time.
0 commit comments