Closed tuif closed 4 years ago
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. I have the same problem with different pages and differente segments.
Thanks for the issue. Can you try the following dev build and let me know if it resolves the issue? 5.1.0-dev.202002172131.9d3e664
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 https://github.com/ionic-team/ionic/pull/20495 and will be available in an upcoming release of Ionic Framework.
We don't comment on the timeline of releases, but we do hope to have 5.0.1 out soon.
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.
After closing the modal, enter again. The ion-segment-button is not checked even if its value matches the bound variable, leaving all buttons unchecked.
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: