web: disable autoscroll at top

This commit is contained in:
Maximilian Hils
2014-12-12 19:43:55 +01:00
parent 588d6dbe22
commit 3b55889310
2 changed files with 10 additions and 2 deletions

View File

@@ -2,7 +2,11 @@
var AutoScrollMixin = {
componentWillUpdate: function () {
var node = this.getDOMNode();
this._shouldScrollBottom = node.scrollTop + node.clientHeight === node.scrollHeight;
this._shouldScrollBottom = (
node.scrollTop !== 0
&&
node.scrollTop + node.clientHeight === node.scrollHeight
);
},
componentDidUpdate: function () {
if (this._shouldScrollBottom) {