question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

bug: refresher, quickly scrolling after cancelling refresh causes duplicate refresh

See original GitHub issue

Prerequisites

Ionic Framework Version

  • v4.x
  • v5.x
  • v6.x
  • Nightly

Current Behavior

When using an Ion Refresher on android, if you pull the refresher down partially (so it does not trigger the onIonRefresh event) and then scroll down quickly, the refresher animation triggers (but does not fire the refresh event) which causes the scroll to jank.

Expected Behavior

Scrolling down rapidly should not cause the refresher to appear.

Steps to Reproduce

Take any ionic app page which has enough content so the page can scroll and add an IonRefresher. Swipe down on the page slightly so the refresher icon begins to enter the page (but do not trigger it). Swipe up rapidly to scroll the page down quickly and the refresher icon will enter the page and cause the scrolling to jank.

Video Example

https://user-images.githubusercontent.com/76167627/172366889-3a36fa23-1e68-429f-aa8f-b771daccfc6f.mp4

An example of the code:


function doRefresh(event: CustomEvent<RefresherEventDetail>) {
  console.log("Begin async operation");

  setTimeout(() => {
    console.log('Async operation has ended');
    event.detail.complete();
  }, 2000);
}

const Tab1: React.FC = () => {
  return (
    <IonPage>
      <IonHeader>
        <IonToolbar>
          <IonTitle>Tab 1</IonTitle>
        </IonToolbar>
      </IonHeader>
      <IonContent fullscreen>
        <IonHeader collapse="condense">
          <IonToolbar>
            <IonTitle size="large">Tab 1</IonTitle>
          </IonToolbar>
        </IonHeader>
        <IonRefresher slot="fixed" onIonRefresh={doRefresh}>
          <IonRefresherContent />
        </IonRefresher>
           {*/ ...Page Content */}
      </IonContent>
    </IonPage>
  );
};

Code Reproduction URL

https://github.com/milanharia/ionic-android-refresher

Ionic Info

Ionic:

Ionic CLI : 6.19.1 (/usr/local/lib/node_modules/@ionic/cli) Ionic Framework : @ionic/react 6.1.8

Capacitor:

Capacitor CLI : 3.5.1 @capacitor/android : 3.5.1 @capacitor/core : 3.5.1 @capacitor/ios : not installed

Utility:

cordova-res : not installed globally native-run : 1.6.0

System:

NodeJS : v16.14.2 (/usr/local/bin/node) npm : 8.7.0 OS : macOS Monterey

Additional Information

No response

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:7 (3 by maintainers)

github_iconTop GitHub Comments

2reactions
liamdebeasicommented, Jun 15, 2022

Thanks for the issue. This has been resolved via https://github.com/ionic-team/ionic-framework/pull/25476, and a fix will be available in an upcoming release of Ionic Framework.

1reaction
milanhariacommented, Jun 15, 2022

I can confirm it is fixed in the dev build!

Read more comments on GitHub >

github_iconTop Results From Across the Web

49475 - History page auto-refresh and lose scrolling position
I'm using Chrome 7.0.517.36 (beta) on Windows 7 Pro 32 bit. None of my extensions involve refreshing/reloading the screen. I went back to...
Read more >
Power BI Refresh Trick – Data Refresh Issues - YouTube
Data refresh issues can be common in Power BI for new report developers. One such error is: 'Column contains duplicate values and this...
Read more >
How can I prevent refresh of page when button inside form is ...
I have an issue while using buttons inside form. I want that button to call function. It does, but with unwanted result that...
Read more >
Mobile web refresher, part 2 - Meta Stack Exchange
Please fix the scrolling bug for duplicate voting. ... It's significantly darker green on mobile, and it makes it harder to read/look at.)....
Read more >
Safari Ajax refresh makes page scroll to top - OutSystems
On a responsive web application when using safari on a mobile device (safari on desktop doesn't behave this way) when using ajax refresh...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found