-
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: ion-segment initial state failed when using NgModel with Angular #20500
Comments
I'm experiencing the same issue using the ion-segment and NgModel. However, it's mixed. Some screens work all the time, some never and some only the first time. |
Here's a sample project with two different segments. The first ion-segment works in the tab1 page (the default tab). The second ion-segment is in the modal screen that is opened via tab1 page. This segment does not work. Please execute "npm install" before running the app. Note: this sample app is using Angular 8. My project is running angular 9 and is experiencing the same issue. |
+1 I have the same problem. On first load my segment buttons correctly show my ngModel, but on second load no segment button is selected. |
Same here. |
Thanks for the issue. Can you try the following dev build and let me know if it resolves the issue? |
This appears to have fix the ion-segment issue. I'm still finding other (binding) issues but the segment is now working. |
@liamdebeasi Around when is the due date of 5.0.1 milestone? |
We don't comment on the timeline of releases, but we do hope to have 5.0.1 out soon. |
Thanks for the issue. This has been resolved via #20495 and will be available in an upcoming release of Ionic Framework. |
Ok I'm sorry, Thanks for the fix! |
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] 5.x
Current behavior:
We are using ion-segment in modal with Angular. For connivence, we use NgModel for two-way binding the checked value of ion-segment.
When showing the modal for the first time, the ion-segment-button is checked when its value matches the bound variable.
Expected behavior:
button is checked when its value equals the bound variable.
Steps to reproduce:
Related code:
https://github.com/tuif/ionic5-segment
Ionic info:
The text was updated successfully, but these errors were encountered: