Scroll to top when changing shown data in source browse
The current scroll position was preserved when changing the shown content type (browse, latest, filters) or when changing the filters.
Regression introduced with aab3e25031
This commit is contained in:
@@ -126,6 +126,9 @@ const HorizontalGrid = forwardRef(
|
||||
),
|
||||
);
|
||||
|
||||
export const getGridSnapshotKey = (location: ReturnType<typeof useLocation>) =>
|
||||
`MangaGrid-snapshot-location-${location.key}`;
|
||||
|
||||
const VerticalGrid = forwardRef(
|
||||
(
|
||||
{
|
||||
@@ -148,7 +151,7 @@ const VerticalGrid = forwardRef(
|
||||
) => {
|
||||
const location = useLocation<{ snapshot?: GridStateSnapshot }>();
|
||||
|
||||
const snapshotSessionKey = `MangaGrid-snapshot-location-${location.key}`;
|
||||
const snapshotSessionKey = getGridSnapshotKey(location);
|
||||
const [snapshot] = useSessionStorage<GridStateSnapshot | undefined>(snapshotSessionKey, undefined);
|
||||
|
||||
const persistGridStateTimeout = useRef<NodeJS.Timeout | undefined>();
|
||||
|
||||
Reference in New Issue
Block a user