mirror of
https://github.com/jeffvli/feishin.git
synced 2026-05-10 04:30:25 +02:00
Persist scroll offset on table-view album list
This commit is contained in:
@@ -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 New Issue
Block a user