Skip to content

Commit

Permalink
fix(infinite-scroll): regression in #8099
Browse files Browse the repository at this point in the history
references #10889
  • Loading branch information
manucorporat committed Mar 23, 2017
1 parent a3ead3d commit 58b57c0
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/components/infinite-scroll/infinite-scroll.ts
Original file line number Diff line number Diff line change
Expand Up @@ -256,7 +256,7 @@ export class InfiniteScroll {
let distanceFromInfinite: number;

if (this._position === POSITION_BOTTOM) {
distanceFromInfinite = ((d.scrollHeight - infiniteHeight) - d.scrollTop) - height - threshold;
distanceFromInfinite = d.scrollHeight - infiniteHeight - d.scrollTop - height - threshold;
} else {
assert(this._position === POSITION_TOP, '_position should be top');
distanceFromInfinite = d.scrollTop - infiniteHeight - threshold;
Expand Down Expand Up @@ -289,6 +289,10 @@ export class InfiniteScroll {
* to `enabled`.
*/
complete() {
if (this.state !== STATE_LOADING) {
return;
}

if (this._position === POSITION_BOTTOM) {
this.state = STATE_ENABLED;
return;
Expand Down

2 comments on commit 58b57c0

@Manduro
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@manucorporat Mhmm, removing those parentheses shouldn't make a difference, right? They were there before as well.

Looking at the PR diff it still seems to me nothing changed for bottom positioned Infinite's.

Just curious, sorry if I broke something ;)

@manucorporat
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Manduro the if (this.state === STATE_LOADING) was removed

Please sign in to comment.