diff --git a/build/react-infinite.js b/build/react-infinite.js index 3a67058..5fca4c3 100644 --- a/build/react-infinite.js +++ b/build/react-infinite.js @@ -47,7 +47,8 @@ var Infinite = React.createClass({displayName: "Infinite", loadingSpinnerDelegate: React.createElement("div", null), onInfiniteLoad: function() {}, isInfiniteLoading: false, - timeScrollStateLastsForAfterUserScrolls: 150 + timeScrollStateLastsForAfterUserScrolls: 150, + sticky: null }; }, @@ -175,6 +176,9 @@ var Infinite = React.createClass({displayName: "Infinite", manageScrollTimeouts:function() { // Maintains a series of timeouts to set this.state.isScrolling // to be true when the element is scrolling. + if (!this.props.timeScrollStateLastsForAfterUserScrolls) { + return; + } if (this.state.scrollTimeout) { clearTimeout(this.state.scrollTimeout); @@ -246,6 +250,7 @@ var Infinite = React.createClass({displayName: "Infinite", React.createElement("div", {ref: "smoothScrollingWrapper", style: infiniteScrollStyles}, React.createElement("div", {ref: "topSpacer", style: this.buildHeightStyle(topSpacerHeight)}), + this.props.sticky, displayables, React.createElement("div", {ref: "bottomSpacer", style: this.buildHeightStyle(bottomSpacerHeight)}), diff --git a/dist/react-infinite.js b/dist/react-infinite.js index 5599992..2e9857f 100644 --- a/dist/react-infinite.js +++ b/dist/react-infinite.js @@ -49,7 +49,8 @@ var Infinite = React.createClass({displayName: "Infinite", loadingSpinnerDelegate: React.createElement("div", null), onInfiniteLoad: function() {}, isInfiniteLoading: false, - timeScrollStateLastsForAfterUserScrolls: 150 + timeScrollStateLastsForAfterUserScrolls: 150, + sticky: null }; }, @@ -177,6 +178,9 @@ var Infinite = React.createClass({displayName: "Infinite", manageScrollTimeouts:function() { // Maintains a series of timeouts to set this.state.isScrolling // to be true when the element is scrolling. + if (!this.props.timeScrollStateLastsForAfterUserScrolls) { + return; + } if (this.state.scrollTimeout) { clearTimeout(this.state.scrollTimeout); @@ -248,6 +252,7 @@ var Infinite = React.createClass({displayName: "Infinite", React.createElement("div", {ref: "smoothScrollingWrapper", style: infiniteScrollStyles}, React.createElement("div", {ref: "topSpacer", style: this.buildHeightStyle(topSpacerHeight)}), + this.props.sticky, displayables, React.createElement("div", {ref: "bottomSpacer", style: this.buildHeightStyle(bottomSpacerHeight)}), diff --git a/src/react-infinite.jsx b/src/react-infinite.jsx index d31982d..d7366af 100644 --- a/src/react-infinite.jsx +++ b/src/react-infinite.jsx @@ -47,7 +47,8 @@ var Infinite = React.createClass({ loadingSpinnerDelegate:
, onInfiniteLoad: () => {}, isInfiniteLoading: false, - timeScrollStateLastsForAfterUserScrolls: 150 + timeScrollStateLastsForAfterUserScrolls: 150, + sticky: null }; }, @@ -175,6 +176,9 @@ var Infinite = React.createClass({ manageScrollTimeouts() { // Maintains a series of timeouts to set this.state.isScrolling // to be true when the element is scrolling. + if (!this.props.timeScrollStateLastsForAfterUserScrolls) { + return; + } if (this.state.scrollTimeout) { clearTimeout(this.state.scrollTimeout); @@ -246,6 +250,7 @@ var Infinite = React.createClass({
+ {this.props.sticky} {displayables}