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 @@ -88,7 +88,6 @@ export const useGridDetailPanel = (
88
88
| 'onDetailPanelExpandedRowIdsChange'
89
89
> ,
90
90
) : void => {
91
- const expandedRowIds = useGridSelector ( apiRef , gridDetailPanelExpandedRowIdsSelector ) ;
92
91
const contentCache = useGridSelector ( apiRef , gridDetailPanelExpandedRowsContentCacheSelector ) ;
93
92
94
93
const handleCellClick = React . useCallback < GridEventListener < 'cellClick' > > (
@@ -171,6 +170,7 @@ export const useGridDetailPanel = (
171
170
} ,
172
171
} ;
173
172
} ) ;
173
+ apiRef . current . requestPipeProcessorsApplication ( 'rowHeight' ) ;
174
174
} ,
175
175
[ apiRef ] ,
176
176
) ;
@@ -290,7 +290,8 @@ export const useGridDetailPanel = (
290
290
291
291
const addDetailHeight = React . useCallback < GridPipeProcessor < 'rowHeight' > > (
292
292
( initialValue , row ) => {
293
- if ( ! expandedRowIds || expandedRowIds . length === 0 || ! expandedRowIds . includes ( row . id ) ) {
293
+ const expandedRowIds = gridDetailPanelExpandedRowIdsSelector ( apiRef ) ;
294
+ if ( ! expandedRowIds || ! expandedRowIds . has ( row . id ) ) {
294
295
initialValue . detail = 0 ;
295
296
return initialValue ;
296
297
}
@@ -302,7 +303,7 @@ export const useGridDetailPanel = (
302
303
initialValue . detail = heightCache [ row . id ] ?? 0 ; // Fallback to zero because the cache might not be ready yet (for example page was changed)
303
304
return initialValue ;
304
305
} ,
305
- [ apiRef , expandedRowIds , updateCachesIfNeeded ] ,
306
+ [ apiRef , updateCachesIfNeeded ] ,
306
307
) ;
307
308
308
309
const enabled = props . getDetailPanelContent !== undefined ;
You can’t perform that action at this time.
0 commit comments