Ionic 4: Set default ionic ion-select option

Struggling to set the default option in an <ion-select> control. Using v4 rc2 but this has been an issue since I started with the late v4 betas.

The <ion-select> correctly sets the default selection but I get the small down caret. The selected option is not displayed. When I select the control, the alert is displayed and the correct option is selected. Or am I doing something wrong?

Does the order of setting the measureSetId vs loading the measureSets[] matter?

Thoughts? appreciate any help on this.

<ion-select name="measureSetSelect" [(ngModel)]="selectedMeasureSetId">
  <ion-select-option *ngFor="let measureSet of measureSets" [value]="measureSet.measureSetId">
    {{measureSet.name}}
  </ion-select-option>
</ion-select>

public measureSets: IMeasureSet[];
public selectedMeasureSetId: number;

ngOnInit() {
this.measureSetsApiService.query().pipe(take(1)).subscribe(result => {
this.selectedMeasureSetId = result.find(i => i.isDefault).measureSetId || 1;
this.measureSets = result;
});
}


#angular #ionic

3 Likes430.95 GEEK