Skip to content

Commit

Permalink
Import throttle from internals package. Do not reset rendering contex…
Browse files Browse the repository at this point in the history
…t when sorting model is updated
  • Loading branch information
arminmeh committed Aug 16, 2024
1 parent 489f978 commit 33b0459
Showing 1 changed file with 2 additions and 4 deletions.
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import * as React from 'react';
import { throttle } from '@mui/x-internals/throttle';
import {
useGridApiEventHandler,
useGridSelector,
Expand All @@ -14,7 +15,6 @@ import {
getVisibleRows,
GridGetRowsParams,
gridRenderContextSelector,
throttle,
} from '@mui/x-data-grid/internals';
import { GridPrivateApiPro } from '../../../models/gridApiPro';
import { DataGridProProcessedProps } from '../../../models/dataGridProProps';
Expand Down Expand Up @@ -143,7 +143,7 @@ export const useGridDataSourceLazyLoader = (
);

const throttledHandleRenderedRowsIntervalChange = React.useMemo(
() => throttle(handleRenderedRowsIntervalChange, 300), // TODO: make it configurable
() => throttle(handleRenderedRowsIntervalChange, 500), // TODO: make it configurable
[handleRenderedRowsIntervalChange],
);

Expand All @@ -158,8 +158,6 @@ export const useGridDataSourceLazyLoader = (
privateApiRef.current.setRows([]);
addSkeletonRows();

renderedRowsIntervalCache.current = INTERVAL_CACHE_INITIAL_STATE;

const getRowsParams: GridGetRowsParams = {
start: renderContext.firstRowIndex,
end: renderContext.lastRowIndex,
Expand Down

0 comments on commit 33b0459

Please sign in to comment.