Skip to content

Commit

Permalink
fix(refresher): quickly swiping down no longer causes duplicate refre…
Browse files Browse the repository at this point in the history
…sh (#25476)

resolves #25418
  • Loading branch information
liamdebeasi authored Jun 15, 2022
1 parent 1641dbc commit 3abfa78
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions core/src/components/refresher/refresher.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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) => {
Expand Down Expand Up @@ -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 = [];
Expand All @@ -394,6 +396,7 @@ export class Refresher implements ComponentInterface {
await snapBackAnimation.play();
this.beginRefresh();
ev.data.animation.destroy();
this.gesture!.enable(true);
});
},
});
Expand Down

0 comments on commit 3abfa78

Please sign in to comment.