Skip to content

Commit

Permalink
[core] Remove dead code
Browse files Browse the repository at this point in the history
  • Loading branch information
oliviertassinari committed Mar 26, 2022
1 parent 6643404 commit c559916
Showing 1 changed file with 0 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ import { gridRowsMetaSelector } from '../rows/gridRowsMetaSelector';
import { GridScrollParams } from '../../../models/params/gridScrollParams';
import { GridScrollApi } from '../../../models/api/gridScrollApi';
import { useGridApiMethod } from '../../utils/useGridApiMethod';
import { useGridNativeEventListener } from '../../utils/useGridNativeEventListener';

// Logic copied from https://www.w3.org/TR/wai-aria-practices/examples/listbox/js/listbox.js
// Similar to https://developer.mozilla.org/en-US/docs/Web/API/Element/scrollIntoView
Expand Down Expand Up @@ -140,16 +139,4 @@ export const useGridScroll = (
getScrollPosition,
};
useGridApiMethod(apiRef, scrollApi, 'GridScrollApi');

const preventScroll = React.useCallback((event: any) => {
event.target.scrollLeft = 0;
event.target.scrollTop = 0;
}, []);

useGridNativeEventListener(
apiRef,
() => apiRef.current?.renderingZoneRef?.current?.parentElement,
'scroll',
preventScroll,
);
};

0 comments on commit c559916

Please sign in to comment.