Fixed: restoring scroll position when going back to index page

This commit is contained in:
ta264
2021-05-13 21:15:11 +01:00
parent 129591de61
commit 93f0f33e84
9 changed files with 54 additions and 9 deletions
@@ -112,7 +112,8 @@ class AuthorIndexBanners extends Component {
items,
sortKey,
bannerOptions,
jumpToCharacter
jumpToCharacter,
scrollTop
} = this.props;
const {
@@ -149,6 +150,10 @@ class AuthorIndexBanners extends Component {
});
}
}
if (this._grid && scrollTop !== 0) {
this._grid.scrollToPosition({ scrollTop });
}
}
//
@@ -306,6 +311,7 @@ AuthorIndexBanners.propTypes = {
sortKey: PropTypes.string,
bannerOptions: PropTypes.object.isRequired,
jumpToCharacter: PropTypes.string,
scrollTop: PropTypes.number.isRequired,
scroller: PropTypes.instanceOf(Element).isRequired,
showRelativeDates: PropTypes.bool.isRequired,
shortDateFormat: PropTypes.string.isRequired,