fix(infinite-scroll): disabled

This commit is contained in:
Manu Mtz.-Almeida
2018-01-25 16:49:20 +01:00
parent 15e067a72f
commit 3e57f23ea0
2 changed files with 4 additions and 5 deletions

View File

@ -1331,7 +1331,6 @@ declare global {
color?: string; color?: string;
href?: string; href?: string;
mode?: 'ios' | 'md'; mode?: 'ios' | 'md';
onclick?: (this: HTMLElement, ev: MouseEvent) => any;
} }
} }
} }

View File

@ -65,7 +65,7 @@ export class InfiniteScroll {
@Watch('disabled') @Watch('disabled')
protected disabledChanged(val: boolean) { protected disabledChanged(val: boolean) {
this.enableScrollEvents(val); this.enableScrollEvents(!val);
} }
/** /**
@ -97,14 +97,14 @@ export class InfiniteScroll {
} }
this.init = true; this.init = true;
this.thresholdChanged(this.threshold); this.thresholdChanged(this.threshold);
this.enableScrollEvents(this.disabled); this.enableScrollEvents(!this.disabled);
if (this.position === Position.Top) { if (this.position === Position.Top) {
this.dom.write(() => this.scrollEl.scrollToBottom(0)); this.dom.write(() => this.scrollEl.scrollToBottom(0));
} }
} }
componentDidUnload() { componentDidUnload() {
this.enableScrollEvents(false); this.enableScrollEvents(!this.disabled);
this.scrollEl = null; this.scrollEl = null;
} }
@ -145,7 +145,7 @@ export class InfiniteScroll {
private canStart(): boolean { private canStart(): boolean {
return ( return (
this.disabled && !this.disabled &&
!this.isBusy && !this.isBusy &&
this.scrollEl && this.scrollEl &&
!this.isLoading); !this.isLoading);