Skip to content

Commit 8dbfb86

Browse files
author
Vikas Agarwal
committed
Github issue #552, Project listing: return user to previous spot in listing after back from project
-- Fixed the case where scroll position was being maintained even in case of user moving between different pages of the project listing.
1 parent 9d6a883 commit 8dbfb86

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/projects/list/components/Projects/Projects.jsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ class Projects extends Component {
1515
}
1616

1717
componentDidUpdate() {
18-
window.scrollTo(0, parseInt(window.sessionStorage.getItem("projectsPageScrollTop")));
18+
window.scrollTo(0, parseInt(window.sessionStorage.getItem("projectsPageScrollTop")));
1919
}
2020

2121
componentWillUnmount(){
@@ -45,6 +45,7 @@ class Projects extends Component {
4545
}
4646

4747
onPageChange(pageNum) {
48+
window.sessionStorage.removeItem('projectsPageScrollTop');
4849
this.routeWithParams(this.props.criteria, pageNum)
4950
}
5051

0 commit comments

Comments
 (0)