-
Notifications
You must be signed in to change notification settings - Fork 13.5k
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: The ionChange event of ion-input is triggered the second time the page is entered #20061
Comments
👋 Hi there! Are you able to provide a small demo repository to debug this? I'm not able to replicate this locally. |
|
In the example, your button's method goToPage pushes the test1 component onto the router history. When you click the ion-back-button, you navigate back in the stack which pops the router history and destroys the component. You are seeing multiple onInit calls because the component is destroying and initializing correctly. |
I changed the example, just to answer the question from @hscheuerle . @mhartington I actually think this might be stencil related? When debugging locally using Ionic 5, and the ionChange on the Ion Toggle component, I see that the @watch seems to be firing before ComponentWillLoad, the 2nd time I visit the page. According to the docs, this should not be happening? link to new stackblitz |
This is still an issue, I just wanted to update that i fixed my problem, by using reactive forms in Angular, instead of the ionChange method, as a work-around. |
We were able to get around this issue by using |
@mread1208, muchas gracias me ayudo bastante tu aporte. |
Same issue here, ionChange is triggered the second time the page is entered, any news on the fix? |
Same issue here.. april 2021 and counting... |
I have this issue, ionChange is firing ionInfinite. |
I have same issue too. The event is triggered even after I switched from |
problem solved here, thank you |
Same issue, also using the |
Hello everyone, we have an open RFC that proposes a change to Please take a moment to review and let us know your thoughts: #25532 |
This issue has been resolved in this pull request: #25858 and will be available in the next major release (v7) of Ionic. |
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. |
Bug Report
Ionic version:
[x] 4.x
Current behavior:
<ion-input [(ngModel)]="tests" (ionChange)="test($event)"></ion-input>
This is triggered the second time the page is accessed
Expected behavior:
If the user is not actively typing, no change event needs to be triggered
The text was updated successfully, but these errors were encountered: