Skip to content

Commit fe7b399

Browse files
author
vikasrohit
authored
Merge pull request #564 from appirio-tech/feature/project_page_scroll_position
Github issue #552, Project listing: return user to previous spot in listing after back from project
2 parents f42e5f7 + 9d6a883 commit fe7b399

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

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

100644100755
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,15 @@ class Projects extends Component {
1414
this.applyFilters = this.applyFilters.bind(this)
1515
}
1616

17+
componentDidUpdate() {
18+
window.scrollTo(0, parseInt(window.sessionStorage.getItem("projectsPageScrollTop")));
19+
}
20+
21+
componentWillUnmount(){
22+
const scrollingElement = document.scrollingElement || document.documentElement;
23+
window.sessionStorage.setItem('projectsPageScrollTop', scrollingElement.scrollTop);
24+
}
25+
1726
componentWillMount() {
1827
document.title = 'Projects - Topcoder'
1928
// this.searchTermFromQuery = this.props.location.query.q || ''

0 commit comments

Comments
 (0)