Skip to content

Commit 58b57c0

Browse files
committed
fix(infinite-scroll): regression in #8099
references #10889
1 parent a3ead3d commit 58b57c0

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/components/infinite-scroll/infinite-scroll.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -256,7 +256,7 @@ export class InfiniteScroll {
256256
let distanceFromInfinite: number;
257257

258258
if (this._position === POSITION_BOTTOM) {
259-
distanceFromInfinite = ((d.scrollHeight - infiniteHeight) - d.scrollTop) - height - threshold;
259+
distanceFromInfinite = d.scrollHeight - infiniteHeight - d.scrollTop - height - threshold;
260260
} else {
261261
assert(this._position === POSITION_TOP, '_position should be top');
262262
distanceFromInfinite = d.scrollTop - infiniteHeight - threshold;
@@ -289,6 +289,10 @@ export class InfiniteScroll {
289289
* to `enabled`.
290290
*/
291291
complete() {
292+
if (this.state !== STATE_LOADING) {
293+
return;
294+
}
295+
292296
if (this._position === POSITION_BOTTOM) {
293297
this.state = STATE_ENABLED;
294298
return;

0 commit comments

Comments
 (0)