mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2025-11-10 00:27:41 +08:00
fix(refresher): resolve undefined issues when updating component (#20322)
fixes #20320
This commit is contained in:
@ -124,10 +124,11 @@ export class Refresher implements ComponentInterface {
|
||||
@Event() ionStart!: EventEmitter<void>;
|
||||
|
||||
private checkNativeRefresher() {
|
||||
if (shouldUseNativeRefresher(this.el, getIonMode(this))) {
|
||||
const useNativeRefresher = shouldUseNativeRefresher(this.el, getIonMode(this));
|
||||
if (useNativeRefresher && !this.nativeRefresher) {
|
||||
const contentEl = this.el.closest('ion-content');
|
||||
this.setupNativeRefresher(contentEl);
|
||||
} else {
|
||||
} else if (!useNativeRefresher) {
|
||||
this.destroyNativeRefresher();
|
||||
}
|
||||
}
|
||||
@ -360,7 +361,7 @@ export class Refresher implements ComponentInterface {
|
||||
}
|
||||
|
||||
private async setupNativeRefresher(contentEl: HTMLIonContentElement | null) {
|
||||
if (this.scrollListenerCallback || !contentEl || this.nativeRefresher) {
|
||||
if (this.scrollListenerCallback || !contentEl || this.nativeRefresher || !this.scrollEl) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user