mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2025-08-24 06:22:45 +08:00
fix(infinite-scroll): disabled
This commit is contained in:
1
packages/core/src/components.d.ts
vendored
1
packages/core/src/components.d.ts
vendored
@ -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;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -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);
|
||||||
|
Reference in New Issue
Block a user