mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2025-11-10 00:27:41 +08:00
fix(refresher): progressEnd no longer errors when pulling quickly in MD native refresher (#23056)
This commit is contained in:
@ -307,6 +307,7 @@ export class Refresher implements ComponentInterface {
|
|||||||
canStart: () => this.state !== RefresherState.Refreshing && this.state !== RefresherState.Completing && this.scrollEl!.scrollTop === 0,
|
canStart: () => this.state !== RefresherState.Refreshing && this.state !== RefresherState.Completing && this.scrollEl!.scrollTop === 0,
|
||||||
onStart: (ev: GestureDetail) => {
|
onStart: (ev: GestureDetail) => {
|
||||||
ev.data = { animation: undefined, didStart: false, cancelled: false };
|
ev.data = { animation: undefined, didStart: false, cancelled: false };
|
||||||
|
this.state = RefresherState.Pulling;
|
||||||
},
|
},
|
||||||
onMove: (ev: GestureDetail) => {
|
onMove: (ev: GestureDetail) => {
|
||||||
if ((ev.velocityY < 0 && this.progress === 0 && !ev.data.didStart) || ev.data.cancelled) {
|
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) {
|
if (!ev.data.didStart) {
|
||||||
ev.data.didStart = true;
|
ev.data.didStart = true;
|
||||||
|
|
||||||
this.state = RefresherState.Pulling;
|
writeTask(() => this.scrollEl!.style.setProperty('--overflow', 'hidden'));
|
||||||
|
|
||||||
writeTask(() => {
|
|
||||||
const animationType = getRefresherAnimationType(contentEl);
|
|
||||||
const animation = createPullingAnimation(animationType, pullingRefresherIcon);
|
|
||||||
ev.data.animation = animation;
|
|
||||||
|
|
||||||
this.scrollEl!.style.setProperty('--overflow', 'hidden');
|
const animationType = getRefresherAnimationType(contentEl);
|
||||||
|
const animation = createPullingAnimation(animationType, pullingRefresherIcon);
|
||||||
animation.progressStart(false, 0);
|
ev.data.animation = animation;
|
||||||
this.ionStart.emit();
|
animation.progressStart(false, 0);
|
||||||
this.animations.push(animation);
|
this.ionStart.emit();
|
||||||
});
|
this.animations.push(animation);
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user