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
@@ -83,7 +83,8 @@ class AuthorIndexTable extends Component {
showBanners,
isSmallScreen,
onSortPress,
scroller
scroller,
scrollTop
} = this.props;
return (
@@ -91,6 +92,7 @@ class AuthorIndexTable extends Component {
className={styles.tableContainer}
items={items}
scrollIndex={this.state.scrollIndex}
scrollTop={scrollTop}
isSmallScreen={isSmallScreen}
scroller={scroller}
rowHeight={showBanners ? 70 : 38}
@@ -120,6 +122,7 @@ AuthorIndexTable.propTypes = {
sortDirection: PropTypes.oneOf(sortDirections.all),
showBanners: PropTypes.bool.isRequired,
jumpToCharacter: PropTypes.string,
scrollTop: PropTypes.number,
scroller: PropTypes.instanceOf(Element).isRequired,
isSmallScreen: PropTypes.bool.isRequired,
onSortPress: PropTypes.func.isRequired