From 67617fbc0f7ec825f1fa4c6e7e2da70e3fcd2d66 Mon Sep 17 00:00:00 2001 From: Liam DeBeasi Date: Tue, 16 Mar 2021 11:28:10 -0400 Subject: [PATCH] fix(refresher): progressEnd no longer errors when pulling quickly in MD native refresher (#23056) --- core/src/components/refresher/refresher.tsx | 20 ++++++++------------ 1 file changed, 8 insertions(+), 12 deletions(-) diff --git a/core/src/components/refresher/refresher.tsx b/core/src/components/refresher/refresher.tsx index c15f800ee3..e453b49122 100644 --- a/core/src/components/refresher/refresher.tsx +++ b/core/src/components/refresher/refresher.tsx @@ -307,6 +307,7 @@ export class Refresher implements ComponentInterface { canStart: () => this.state !== RefresherState.Refreshing && this.state !== RefresherState.Completing && this.scrollEl!.scrollTop === 0, onStart: (ev: GestureDetail) => { ev.data = { animation: undefined, didStart: false, cancelled: false }; + this.state = RefresherState.Pulling; }, onMove: (ev: GestureDetail) => { if ((ev.velocityY < 0 && this.progress === 0 && !ev.data.didStart) || ev.data.cancelled) { @@ -317,19 +318,14 @@ export class Refresher implements ComponentInterface { if (!ev.data.didStart) { ev.data.didStart = true; - this.state = RefresherState.Pulling; - - writeTask(() => { - const animationType = getRefresherAnimationType(contentEl); - const animation = createPullingAnimation(animationType, pullingRefresherIcon); - ev.data.animation = animation; + writeTask(() => this.scrollEl!.style.setProperty('--overflow', 'hidden')); - this.scrollEl!.style.setProperty('--overflow', 'hidden'); - - animation.progressStart(false, 0); - this.ionStart.emit(); - this.animations.push(animation); - }); + const animationType = getRefresherAnimationType(contentEl); + const animation = createPullingAnimation(animationType, pullingRefresherIcon); + ev.data.animation = animation; + animation.progressStart(false, 0); + this.ionStart.emit(); + this.animations.push(animation); return; }