Remove scrolling behavior

Signed-off-by: Oliver Sand <oliver.sand@sda-se.com>
This commit is contained in:
Oliver Sand
2021-09-02 10:17:22 +02:00
parent 532b4cc656
commit 66be814579
2 changed files with 0 additions and 7 deletions
@@ -43,7 +43,6 @@ describe('SearchContext', () => {
beforeEach(() => {
query.mockResolvedValue({});
(useApi as jest.Mock).mockReturnValue({ query: query });
window.scrollTo = jest.fn();
});
afterAll(() => {
@@ -93,11 +93,9 @@ export const SearchContextProvider = ({
!result.loading && !result.error && result.value?.previousPageCursor;
const fetchNextPage = useCallback(() => {
setPageCursor(result.value?.nextPageCursor);
resetScrollPosition();
}, [result.value?.nextPageCursor]);
const fetchPreviousPage = useCallback(() => {
setPageCursor(result.value?.previousPageCursor);
resetScrollPosition();
}, [result.value?.previousPageCursor]);
useEffect(() => {
@@ -131,7 +129,3 @@ export const useSearch = () => {
}
return context;
};
function resetScrollPosition() {
window.scrollTo({ top: 0, left: 0, behavior: 'smooth' });
}