Persist scroll offset on table-view album list
This commit is contained in:
parent
9c1a2a4a8d
commit
791088deb6
1 changed files with 3 additions and 1 deletions
|
@ -103,8 +103,9 @@ export const AlbumListContent = ({ itemCount, gridRef, tableRef }: AlbumListCont
|
||||||
rowCount: undefined,
|
rowCount: undefined,
|
||||||
};
|
};
|
||||||
params.api.setDatasource(dataSource);
|
params.api.setDatasource(dataSource);
|
||||||
|
params.api.ensureIndexVisible(table.scrollOffset || 0, 'top');
|
||||||
},
|
},
|
||||||
[filter, queryClient, server],
|
[filter, queryClient, server, table.scrollOffset],
|
||||||
);
|
);
|
||||||
|
|
||||||
const onTablePaginationChanged = useCallback(
|
const onTablePaginationChanged = useCallback(
|
||||||
|
@ -207,6 +208,7 @@ export const AlbumListContent = ({ itemCount, gridRef, tableRef }: AlbumListCont
|
||||||
|
|
||||||
const handleGridScroll = useCallback(
|
const handleGridScroll = useCallback(
|
||||||
(e: ListOnScrollProps) => {
|
(e: ListOnScrollProps) => {
|
||||||
|
console.log('e', e.scrollOffset);
|
||||||
setGrid({ data: { scrollOffset: e.scrollOffset }, key: pageKey });
|
setGrid({ data: { scrollOffset: e.scrollOffset }, key: pageKey });
|
||||||
},
|
},
|
||||||
[pageKey, setGrid],
|
[pageKey, setGrid],
|
||||||
|
|
Reference in a new issue