Remove scroll persistence when viewing artist songs
This commit is contained in:
parent
fc9d4616ba
commit
3f424b72f6
1 changed files with 5 additions and 1 deletions
|
@ -92,7 +92,10 @@ export const SongListContent = ({ customFilters, itemCount, tableRef }: SongList
|
||||||
rowCount: undefined,
|
rowCount: undefined,
|
||||||
};
|
};
|
||||||
params.api.setDatasource(dataSource);
|
params.api.setDatasource(dataSource);
|
||||||
params.api.ensureIndexVisible(page.table.scrollOffset, 'top');
|
|
||||||
|
if (!customFilters) {
|
||||||
|
params.api.ensureIndexVisible(page.table.scrollOffset, 'top');
|
||||||
|
}
|
||||||
},
|
},
|
||||||
[customFilters, page.filter, page.table.scrollOffset, queryClient, server],
|
[customFilters, page.filter, page.table.scrollOffset, queryClient, server],
|
||||||
);
|
);
|
||||||
|
@ -147,6 +150,7 @@ export const SongListContent = ({ customFilters, itemCount, tableRef }: SongList
|
||||||
const debouncedColumnChange = debounce(handleColumnChange, 200);
|
const debouncedColumnChange = debounce(handleColumnChange, 200);
|
||||||
|
|
||||||
const handleScroll = (e: BodyScrollEvent) => {
|
const handleScroll = (e: BodyScrollEvent) => {
|
||||||
|
if (customFilters) return;
|
||||||
const scrollOffset = Number((e.top / page.table.rowHeight).toFixed(0));
|
const scrollOffset = Number((e.top / page.table.rowHeight).toFixed(0));
|
||||||
setTable({ scrollOffset });
|
setTable({ scrollOffset });
|
||||||
};
|
};
|
||||||
|
|
Reference in a new issue