mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2025-08-19 19:57:22 +08:00
fix(refresher): quickly swiping down no longer causes duplicate refresh (#25476)
resolves #25418
This commit is contained in:
@ -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;
|
||||
}
|
||||
|
||||
writeTask(() => this.scrollEl!.style.removeProperty('--overflow'));
|
||||
if (this.progress <= 0.4) {
|
||||
this.gesture!.enable(false);
|
||||
|
||||
writeTask(() => this.scrollEl!.style.removeProperty('--overflow'));
|
||||
if (this.progress <= 0.4) {
|
||||
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);
|
||||
});
|
||||
},
|
||||
});
|
||||
|
Reference in New Issue
Block a user