Skip to content

Commit

Permalink
fix(refresher): resolve undefined issues when updating component (#20322
Browse files Browse the repository at this point in the history
)

fixes #20320
  • Loading branch information
liamdebeasi authored Jan 28, 2020
1 parent f1e3e42 commit 59d8687
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions core/src/components/refresher/refresher.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}
}
Expand Down Expand Up @@ -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;
}

Expand Down

0 comments on commit 59d8687

Please sign in to comment.