I wanted to try the ion-radio component. Seems to work, but if I put one of my radio with checked=“true”, it does not check it by default when the view loads. Any thoughts?
<ion-radio value="byUnitId" checked="true">
Unit ID
</ion-radio>
<ion-radio value="byMac">
MAC Address
</ion-radio>
<ion-radio value="byUnitName">
Unit Name
</ion-radio>
You shouldn’t need those (click) events (unless that function is doing something other than changing the value of status), we have a sample radio group in our tests that looks similar without the click events:
I think its broken, i cant even use it.
When some value is selected and i try to select another it wont update the selected value.
Is it happening to you?
The check mark will always be set to the last item. Though, the item clicked is correctly set. So for now, I put a an item below the ion-radios to display the item selected just to confirm. So far, that solution is ok for me until they fix it. Still alpha, we have to deal with it.
<ion-content>
<ion-list radio-group>
<ion-radio value="orderBy1" (click)="selected('orderBy1')" [checked]="orderBy1">
Order By 1
</ion-radio>
<ion-radio value="orderBy2" (click)="selected('orderBy2')">
Order By 2
</ion-radio>
<ion-radio value="orderBy3" (click)="selected('orderBy3')">
Order By 3
</ion-radio>
</ion-list>
<ion-item>Order by: {{orderBy}}</ion-item>
</ion-content>
You should give a try with the Ionic 2 version. I think it is still in development with some issue. Even the example in their doc does not work properly. Mine does not behave the same way though.