From 58b57c0ca756e16e7dc9e0e47c8a4da288b0e84f Mon Sep 17 00:00:00 2001 From: "Manu Mtz.-Almeida" Date: Thu, 23 Mar 2017 17:54:14 +0100 Subject: [PATCH] fix(infinite-scroll): regression in #8099 references #10889 --- src/components/infinite-scroll/infinite-scroll.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/components/infinite-scroll/infinite-scroll.ts b/src/components/infinite-scroll/infinite-scroll.ts index f83ce91ec1..4741424c03 100644 --- a/src/components/infinite-scroll/infinite-scroll.ts +++ b/src/components/infinite-scroll/infinite-scroll.ts @@ -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; @@ -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;