Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bug: refresher stop working if not in a delayed call #20803

Closed
RoyeA opened this issue Mar 18, 2020 · 15 comments
Closed

bug: refresher stop working if not in a delayed call #20803

RoyeA opened this issue Mar 18, 2020 · 15 comments
Labels
package: core @ionic/core package type: bug a confirmed bug report
Milestone

Comments

@RoyeA
Copy link

RoyeA commented Mar 18, 2020

Bug Report

Ionic version:
[x] 5.x

Current behavior:
When using an ion-refresher that needs to be canceled/complete in a non-delayed code, the ion-refresher will stop to respond for secondary pull/use.

Expected behavior:
when calling on the event.target.complete() ( regardless if in delayed code, or direct ) the refresher needs to be ready for any future use/pull.

Steps to reproduce:
in the html:
.
.
.
<ion-refresher slot="fixed" (ionRefresh)="doRefresh($event)">


.
.
.

In the *.ts code:
doRefresh(event){
event.target.complete();
}

Other information:
The only solution that I found is to wrap the complete() in a setTimeout call as follows:
setTimeout(()=>{event.target.complete();},0);

Ionic info:

Ionic:

Ionic CLI : 6.2.0 (/usr/local/lib/node_modules/@ionic/cli)
Ionic Framework : @ionic/angular 5.0.5
@angular-devkit/build-angular : 0.803.25
@angular-devkit/schematics : 8.3.25
@angular/cli : 8.3.25
@ionic/angular-toolkit : 2.2.0

Utility:

cordova-res : not installed
native-run : 0.3.0

System:

NodeJS : v12.14.1 (/usr/local/node-v12.14.1-linux-x64/bin/node)
npm : 6.13.4
OS : Linux 4.15

@ionitron-bot ionitron-bot bot added the triage label Mar 18, 2020
@RoyeA RoyeA changed the title bug: refresher stop working if not in async delayed call bug: refresher stop working if not in a delayed call Mar 18, 2020
@liamdebeasi
Copy link
Member

Thanks for the issue. Can you provide a repo with the code required to reproduce this issue?

@liamdebeasi liamdebeasi added the needs: reply the issue needs a response from the user label Mar 18, 2020
@ionitron-bot ionitron-bot bot removed the triage label Mar 18, 2020
@RoyeA
Copy link
Author

RoyeA commented Mar 18, 2020

Is there an online ionic5 that I can use like the https://stackblitz.com/edit/ionic-v4-angular-tabs ?
The refresher works in ionic4, but I moved to ionic5.

@ionitron-bot ionitron-bot bot added triage and removed needs: reply the issue needs a response from the user labels Mar 18, 2020
@liamdebeasi
Copy link
Member

@RoyeA You can just install Ionic Framework v5 in that starter.

@liamdebeasi liamdebeasi added the needs: reply the issue needs a response from the user label Mar 18, 2020
@ionitron-bot ionitron-bot bot removed the triage label Mar 18, 2020
@RoyeA
Copy link
Author

RoyeA commented Mar 18, 2020

Hi @liamdebeasi, I tried to modify the code for v5, but I guess I truly don't know how to install ionic framework v5 in that starter :(
Do you have any sample of v5 that I can use?, or mabye, assist me ?
Sorry to bother you,
Roye

@ionitron-bot ionitron-bot bot added triage and removed needs: reply the issue needs a response from the user labels Mar 18, 2020
@liamdebeasi
Copy link
Member

It might be easier to create your project in a GitHub repo and send a link.

@liamdebeasi liamdebeasi added the needs: reply the issue needs a response from the user label Mar 18, 2020
@ionitron-bot ionitron-bot bot removed the triage label Mar 18, 2020
@RoyeA
Copy link
Author

RoyeA commented Mar 18, 2020

Here is the link to the repo
https://github.com/RoyeA/ionic5-refresh-issue

@ionitron-bot ionitron-bot bot added triage and removed needs: reply the issue needs a response from the user labels Mar 18, 2020
@liamdebeasi liamdebeasi added package: core @ionic/core package type: bug a confirmed bug report labels Mar 18, 2020
@liamdebeasi liamdebeasi added this to the 5.0.6 milestone Mar 18, 2020
@ionitron-bot ionitron-bot bot removed the triage label Mar 18, 2020
@liamdebeasi
Copy link
Member

Thanks for the issue. Can you try the following dev build and let me know if it resolves the issue?

npm i @ionic/angular@5.1.0-dev.202003182027.f86c826

@RoyeA
Copy link
Author

RoyeA commented Mar 18, 2020

Same behavior :(

@liamdebeasi
Copy link
Member

What device are you testing this on?

@RoyeA
Copy link
Author

RoyeA commented Mar 18, 2020

On a Ubuntu linux desktop, using "ionic serve".

@liamdebeasi
Copy link
Member

Ok try this dev build:

npm i @ionic/angular@5.1.0-dev.202003182304.a5f0dc3

@RoyeA
Copy link
Author

RoyeA commented Mar 18, 2020

We have a winner.
It works.

@liamdebeasi
Copy link
Member

Thanks for the issue. This has been resolved via #20815 and will be available in an upcoming release of Ionic Framework.

@RoyeA
Copy link
Author

RoyeA commented Mar 19, 2020

Thank you

@ionitron-bot
Copy link

ionitron-bot bot commented Apr 18, 2020

Thanks for the issue! This issue is being locked to prevent comments that are not relevant to the original issue. If this is still an issue with the latest version of Ionic, please create a new issue and ensure the template is fully filled out.

@ionitron-bot ionitron-bot bot locked and limited conversation to collaborators Apr 18, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
package: core @ionic/core package type: bug a confirmed bug report
Projects
None yet
Development

No branches or pull requests

2 participants