From 3e57f23ea0fd2b7096b2c82c88862bb820767b68 Mon Sep 17 00:00:00 2001 From: "Manu Mtz.-Almeida" Date: Thu, 25 Jan 2018 16:49:20 +0100 Subject: [PATCH] fix(infinite-scroll): disabled --- packages/core/src/components.d.ts | 1 - .../src/components/infinite-scroll/infinite-scroll.tsx | 8 ++++---- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/packages/core/src/components.d.ts b/packages/core/src/components.d.ts index 525c682490..920f5ab493 100644 --- a/packages/core/src/components.d.ts +++ b/packages/core/src/components.d.ts @@ -1331,7 +1331,6 @@ declare global { color?: string; href?: string; mode?: 'ios' | 'md'; - onclick?: (this: HTMLElement, ev: MouseEvent) => any; } } } diff --git a/packages/core/src/components/infinite-scroll/infinite-scroll.tsx b/packages/core/src/components/infinite-scroll/infinite-scroll.tsx index 6890d5d6b2..2e4534dd2c 100644 --- a/packages/core/src/components/infinite-scroll/infinite-scroll.tsx +++ b/packages/core/src/components/infinite-scroll/infinite-scroll.tsx @@ -65,7 +65,7 @@ export class InfiniteScroll { @Watch('disabled') protected disabledChanged(val: boolean) { - this.enableScrollEvents(val); + this.enableScrollEvents(!val); } /** @@ -97,14 +97,14 @@ export class InfiniteScroll { } this.init = true; this.thresholdChanged(this.threshold); - this.enableScrollEvents(this.disabled); + this.enableScrollEvents(!this.disabled); if (this.position === Position.Top) { this.dom.write(() => this.scrollEl.scrollToBottom(0)); } } componentDidUnload() { - this.enableScrollEvents(false); + this.enableScrollEvents(!this.disabled); this.scrollEl = null; } @@ -145,7 +145,7 @@ export class InfiniteScroll { private canStart(): boolean { return ( - this.disabled && + !this.disabled && !this.isBusy && this.scrollEl && !this.isLoading);