Native Scrolling and Pull to Refresh perfomance


#1

Hi!

Yesterday i’ve implemented a native scrolling in my app and i’ve noticed that when i enable it, the perfomance of my ion-content is much better, but the pull to refresh perfomances is very poor, is soo slow and is not smooth at all…

I’ve noticed that adding crosswalk with native scroll the perfomance (general) downs too…

can i fix that?

Thanks!!


#2
<ion-refresher  pulling-text="Pull to refresh..." on-refresh="doRefresh()" spinner="none">
</ion-refresher>

set attribute spinner = “none”


#3

thanks but the issue is still happend…

it don’t feel smooth and native :frowning:


#4

Would you be able to provide a simple demo of this?


#5

Hi,
my refresher didn’t feel smooth either, since the async refresh operation I was trying to do lasted few hundred milliseconds.
So to make it look smoother to the user I added a delay in this way:

  async doRefresh(refresher) {
    console.log('Begin async operation', refresher);

    await new Promise(resolve =>
      setTimeout(resolve, 1000)
    );

    console.log('Async operation has ended');
    refresher.complete();

  }

I had to add async in the definition of the function:

  async doRefresh(refresher) {

and this sleep:

    await new Promise(resolve =>
      setTimeout(resolve, 1000)
    );

Change the 1000 in that timeout to whatever value you see fit in your app.
Cheers,
Gustavo.