Restore scroll on infinite lists
This commit is contained in:
parent
ec79d91d30
commit
1fee4c1946
3 changed files with 6 additions and 4 deletions
|
@ -121,9 +121,9 @@ export const AlbumArtistListContent = ({ gridRef, tableRef }: AlbumArtistListCon
|
||||||
rowCount: undefined,
|
rowCount: undefined,
|
||||||
};
|
};
|
||||||
params.api.setDatasource(dataSource);
|
params.api.setDatasource(dataSource);
|
||||||
// params.api.ensureIndexVisible(page.table.scrollOffset || 0, 'top');
|
params.api.ensureIndexVisible(page.table.scrollOffset || 0, 'top');
|
||||||
},
|
},
|
||||||
[page.filter, queryClient, server],
|
[page.filter, page.table.scrollOffset, queryClient, server],
|
||||||
);
|
);
|
||||||
|
|
||||||
const onTablePaginationChanged = useCallback(
|
const onTablePaginationChanged = useCallback(
|
||||||
|
|
|
@ -102,8 +102,9 @@ export const PlaylistListContent = ({ tableRef }: PlaylistListContentProps) => {
|
||||||
rowCount: undefined,
|
rowCount: undefined,
|
||||||
};
|
};
|
||||||
params.api.setDatasource(dataSource);
|
params.api.setDatasource(dataSource);
|
||||||
|
params.api.ensureIndexVisible(page.table.scrollOffset, 'top');
|
||||||
},
|
},
|
||||||
[page.filter, queryClient, server],
|
[page.filter, page.table.scrollOffset, queryClient, server],
|
||||||
);
|
);
|
||||||
|
|
||||||
const onPaginationChanged = useCallback(
|
const onPaginationChanged = useCallback(
|
||||||
|
|
|
@ -104,8 +104,9 @@ export const SongListContent = ({ tableRef }: SongListContentProps) => {
|
||||||
rowCount: undefined,
|
rowCount: undefined,
|
||||||
};
|
};
|
||||||
params.api.setDatasource(dataSource);
|
params.api.setDatasource(dataSource);
|
||||||
|
params.api.ensureIndexVisible(page.table.scrollOffset, 'top');
|
||||||
},
|
},
|
||||||
[page.filter, queryClient, server],
|
[page.filter, page.table.scrollOffset, queryClient, server],
|
||||||
);
|
);
|
||||||
|
|
||||||
const onPaginationChanged = useCallback(
|
const onPaginationChanged = useCallback(
|
||||||
|
|
Reference in a new issue