-
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: Toggle call ionChange on view init #8070
Comments
Hello! Thanks for opening an issue with us! As this seems like more of a support question i will urge that you ask this question on our forum. Thanks for using Ionic! |
@jgw96 That is not abouy support its a bug... |
Hello @MatanYed sorry for the misunderstanding! Would you mind sharing a code sample that i can use to reproduce this issue? Thanks! |
@jgw96 i am sorry i am from the phone so i cant put here code |
No problem, thanks! Are you initializing the value |
Hi,
The model
Hope this help. |
I can't reproduce this issue, in fact it was already fixed a long time ago: What version of ionic are you using? |
I can reproduce the issue again on Ionic 3. I have fetched the value from backend and set the field in both constructor and ngOnInit. Both ways cause event to fire. Ionic version: "ionic-angular": "3.0.1" Constructor code:
} HTML:
|
but this is not a sync task... the value is changed before the component is initialized |
I have just refactored code so that I don't have async HTTP request anymore. It's just simple value assignment now.
still fires the event though... |
@VSMax can you update to 3.1? |
Sure, I will let you know soon if the issue still exists. |
Upgraded to Ionic 3.1, my packages now:
but the problem still remains |
After upgrading to 3.1.1 issue is fixed. |
@mcwienczek I am now on Ionic 3.2.0 and this is still an issue for me. |
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. |
Type: bug
Ionic Version: 2.x
Platform: all
This is my toggle:
<ion-toggle [(ngModel)]="workMode" (ionChange)="workModeChanged()">
if
this.workMode == true
soworkModeChanged
callback will called on page init, even without click on the toggle. that is the bug.if
this.workMode == false
there is no bug.Thanks
The text was updated successfully, but these errors were encountered: