From 3abfa780ccb32484b4d9f1b509e7ab910dfb901a Mon Sep 17 00:00:00 2001 From: Liam DeBeasi Date: Wed, 15 Jun 2022 14:33:25 -0400 Subject: [PATCH] fix(refresher): quickly swiping down no longer causes duplicate refresh (#25476) resolves #25418 --- core/src/components/refresher/refresher.tsx | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/core/src/components/refresher/refresher.tsx b/core/src/components/refresher/refresher.tsx index 56b85f7470..50fd4d3ddf 100644 --- a/core/src/components/refresher/refresher.tsx +++ b/core/src/components/refresher/refresher.tsx @@ -337,6 +337,8 @@ export class Refresher implements ComponentInterface { this.state !== RefresherState.Completing && this.scrollEl!.scrollTop === 0, onStart: (ev: GestureDetail) => { + this.progress = 0; + ev.data = { animation: undefined, didStart: false, cancelled: false }; }, onMove: (ev: GestureDetail) => { @@ -372,10 +374,10 @@ export class Refresher implements ComponentInterface { return; } + this.gesture!.enable(false); + writeTask(() => this.scrollEl!.style.removeProperty('--overflow')); if (this.progress <= 0.4) { - this.gesture!.enable(false); - ev.data.animation.progressEnd(0, this.progress, 500).onFinish(() => { this.animations.forEach((ani) => ani.destroy()); this.animations = []; @@ -394,6 +396,7 @@ export class Refresher implements ComponentInterface { await snapBackAnimation.play(); this.beginRefresh(); ev.data.animation.destroy(); + this.gesture!.enable(true); }); }, });