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
@@ -114,7 +114,8 @@ class AuthorIndexPosters extends Component {
sortKey,
posterOptions,
jumpToCharacter,
isSmallScreen
isSmallScreen,
scrollTop
} = this.props;
const {
@@ -151,6 +152,10 @@ class AuthorIndexPosters extends Component {
});
}
}
if (this._grid && scrollTop !== 0) {
this._grid.scrollToPosition({ scrollTop });
}
}
//
@@ -314,6 +319,7 @@ AuthorIndexPosters.propTypes = {
sortKey: PropTypes.string,
posterOptions: PropTypes.object.isRequired,
jumpToCharacter: PropTypes.string,
scrollTop: PropTypes.number.isRequired,
scroller: PropTypes.instanceOf(Element).isRequired,
showRelativeDates: PropTypes.bool.isRequired,
shortDateFormat: PropTypes.string.isRequired,