Skip to content

Commit

Permalink
fix(refresher): properly dismiss refresher when completed synchronous…
Browse files Browse the repository at this point in the history
…ly (#20815)

fixes #20803
  • Loading branch information
liamdebeasi committed Mar 25, 2020
1 parent cdfd50b commit b1a87c8
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions core/src/components/refresher/refresher.tsx
Expand Up @@ -3,7 +3,7 @@ import { Component, ComponentInterface, Element, Event, EventEmitter, Host, Meth
import { getTimeGivenProgression } from '../../';
import { getIonMode } from '../../global/ionic-global';
import { Animation, Gesture, GestureDetail, RefresherEventDetail } from '../../interface';
import { clamp } from '../../utils/helpers';
import { clamp, raf } from '../../utils/helpers';
import { hapticImpact } from '../../utils/native/haptic';

import { createPullingAnimation, createSnapBackAnimation, getRefresherAnimationType, handleScrollWhilePulling, handleScrollWhileRefreshing, setSpinnerOpacity, shouldUseNativeRefresher, transitionEndAsync, translateElement } from './refresher.utils';
Expand Down Expand Up @@ -442,7 +442,7 @@ export class Refresher implements ComponentInterface {

// Do not reset scroll el until user removes pointer from screen
if (!this.pointerDown) {
this.resetNativeRefresher(this.elementToTransform, RefresherState.Completing);
raf(() => raf(() => this.resetNativeRefresher(this.elementToTransform, RefresherState.Completing)));
}
} else {
this.close(RefresherState.Completing, '120ms');
Expand All @@ -457,7 +457,7 @@ export class Refresher implements ComponentInterface {
if (this.nativeRefresher) {
// Do not reset scroll el until user removes pointer from screen
if (!this.pointerDown) {
this.resetNativeRefresher(this.elementToTransform, RefresherState.Cancelling);
raf(() => raf(() => this.resetNativeRefresher(this.elementToTransform, RefresherState.Cancelling)));
}
} else {
this.close(RefresherState.Cancelling, '');
Expand Down

0 comments on commit b1a87c8

Please sign in to comment.