From 59d86873a2ab913358b084bb05180ba176893a8f Mon Sep 17 00:00:00 2001 From: Liam DeBeasi Date: Tue, 28 Jan 2020 14:59:58 -0500 Subject: [PATCH] fix(refresher): resolve undefined issues when updating component (#20322) fixes #20320 --- core/src/components/refresher/refresher.tsx | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/core/src/components/refresher/refresher.tsx b/core/src/components/refresher/refresher.tsx index 51509e5a02b..0969d0cd075 100644 --- a/core/src/components/refresher/refresher.tsx +++ b/core/src/components/refresher/refresher.tsx @@ -124,10 +124,11 @@ export class Refresher implements ComponentInterface { @Event() ionStart!: EventEmitter; 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; }