Fix(challenges): scroll instruction panel to top between challenges

closes #9361
This commit is contained in:
Berkeley Martinez
2016-07-01 19:32:02 -07:00
parent 39bbdbc198
commit 2f87c03611

View File

@@ -1,4 +1,5 @@
import React, { PropTypes } from 'react';
import ReactDom from 'react-dom';
import { createSelector } from 'reselect';
import { connect } from 'react-redux';
@@ -75,6 +76,12 @@ export class SidePanel extends PureComponent {
});
}
componentWillReceiveProps(nextProps) {
if (this.props.title !== nextProps.title) {
ReactDom.findDOMNode(this).scrollTop = 0;
}
}
render() {
const {
title,