Add 'startAtBottom' flag
Controls whether a scrollPanel starts off at the bottom. This may not be necessary and could either be derived from stickyBottom, but this means I can be sure that the behaviour of ScrollPanel is completely unchanged for all other uses to avoid breaking any other uses of ScrollPanel.pull/21833/head
parent
1341ffca59
commit
806ef11fde
|
@ -77,6 +77,11 @@ module.exports = React.createClass({
|
||||||
*/
|
*/
|
||||||
stickyBottom: React.PropTypes.bool,
|
stickyBottom: React.PropTypes.bool,
|
||||||
|
|
||||||
|
/* startAtBottom: if set to true, the view is assumed to start
|
||||||
|
* scrolled to the bottom.
|
||||||
|
*/
|
||||||
|
startAtBottom: React.PropTypes.bool,
|
||||||
|
|
||||||
/* onFillRequest(backwards): a callback which is called on scroll when
|
/* onFillRequest(backwards): a callback which is called on scroll when
|
||||||
* the user nears the start (backwards = true) or end (backwards =
|
* the user nears the start (backwards = true) or end (backwards =
|
||||||
* false) of the list.
|
* false) of the list.
|
||||||
|
@ -113,6 +118,7 @@ module.exports = React.createClass({
|
||||||
getDefaultProps: function() {
|
getDefaultProps: function() {
|
||||||
return {
|
return {
|
||||||
stickyBottom: true,
|
stickyBottom: true,
|
||||||
|
startAtBottom: true,
|
||||||
onFillRequest: function(backwards) { return q(false); },
|
onFillRequest: function(backwards) { return q(false); },
|
||||||
onScroll: function() {},
|
onScroll: function() {},
|
||||||
};
|
};
|
||||||
|
@ -324,7 +330,7 @@ module.exports = React.createClass({
|
||||||
* child list.)
|
* child list.)
|
||||||
*/
|
*/
|
||||||
resetScrollState: function() {
|
resetScrollState: function() {
|
||||||
this.scrollState = {stuckAtBottom: true};
|
this.scrollState = {stuckAtBottom: this.props.startAtBottom};
|
||||||
},
|
},
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
Loading…
Reference in New Issue