Something sketchy is going on somewhere outside what you have posted. Modifying the bound segment property switches segment buttons, even without manual change detection as it looks like you are using.
You are right, there is something sketchy going on outside but I’ve not been able to identify it yet.
I recreated a blank app just to test a simple segment and as you said, things work even without changeDetection.
So i came back to my project and created a test page with just a segment with buttons and a function call to switch the segments…it doesn’t work (segment switches but segment tab remains same).
I updated cordova, ionic, angular…can’t figure what else could be different between the two apps.
After creating a dummy project and literally moving each piece of code one-by-one, I finally got the problem…
changeDetectionStrategy with ion-segment has some sort of a bug…
If changeDetection is active on a page, the ion-segment default page selection does not work…if you disable the changeDetection, segment selection starts working.
Ran into this issue as well for my ion-segment. Here’s how I fixed it. I used the ChangeDetectorRef and detected my changes everytime the ion-segment called (ionChange).
<ion-segment [(ngModel)]="status" style="margin: 20px 0" (ionChange)="segmentChanged()" >
I had this issue occurring only on actual mobile devices and emulators; not in ionic serve.
It happened whether I was using ngSwitchCase or multiple ngIfs. Calling detectChanges() manually worked for me, which is crazy. Seems like something is definitely broken.
In my case segment doesn’t work when I use my Ionic App into an Electron page.
When I click on a segment it doesn’t show the data of the chosen segment.
It was working just until some day ago, an update broke this feature.
It still works using ionic serve.
I’m looking for the update that caused this thing.