Skip to content

Commit 67617fb

Browse files
authoredMar 16, 2021
fix(refresher): progressEnd no longer errors when pulling quickly in MD native refresher (#23056)
1 parent c877061 commit 67617fb

File tree

1 file changed

+8
-12
lines changed

1 file changed

+8
-12
lines changed
 

‎core/src/components/refresher/refresher.tsx

+8-12
Original file line numberDiff line numberDiff line change
@@ -307,6 +307,7 @@ export class Refresher implements ComponentInterface {
307307
canStart: () => this.state !== RefresherState.Refreshing && this.state !== RefresherState.Completing && this.scrollEl!.scrollTop === 0,
308308
onStart: (ev: GestureDetail) => {
309309
ev.data = { animation: undefined, didStart: false, cancelled: false };
310+
this.state = RefresherState.Pulling;
310311
},
311312
onMove: (ev: GestureDetail) => {
312313
if ((ev.velocityY < 0 && this.progress === 0 && !ev.data.didStart) || ev.data.cancelled) {
@@ -317,19 +318,14 @@ export class Refresher implements ComponentInterface {
317318
if (!ev.data.didStart) {
318319
ev.data.didStart = true;
319320

320-
this.state = RefresherState.Pulling;
321-
322-
writeTask(() => {
323-
const animationType = getRefresherAnimationType(contentEl);
324-
const animation = createPullingAnimation(animationType, pullingRefresherIcon);
325-
ev.data.animation = animation;
321+
writeTask(() => this.scrollEl!.style.setProperty('--overflow', 'hidden'));
326322

327-
this.scrollEl!.style.setProperty('--overflow', 'hidden');
328-
329-
animation.progressStart(false, 0);
330-
this.ionStart.emit();
331-
this.animations.push(animation);
332-
});
323+
const animationType = getRefresherAnimationType(contentEl);
324+
const animation = createPullingAnimation(animationType, pullingRefresherIcon);
325+
ev.data.animation = animation;
326+
animation.progressStart(false, 0);
327+
this.ionStart.emit();
328+
this.animations.push(animation);
333329

334330
return;
335331
}

0 commit comments

Comments
 (0)