I am porting my app from Iconic 3 to Ionic 4.
I have noticed that the selects now dismiss when you click on the backdrop. Previously, int eh Ionic 3 version, I had this so this did not happen (ie user had to select OK or Cancel)
I tried to set backdropDismiss
to false…
<ion-select backdropDismiss = false></<ion-select >
But this did not help.
Is there any way to do this?
Thanks in advance!
If anyone else needs this, it is not a bug (thanks to @ jaipresto), the syntax is…
<ion-select [interfaceOptions]='{ backdropDismiss: false }'
@peterjc how did you do this in ionic 3?
@yawnnolly
In Ionic 3, I had the following…
Alert…
let alert = this.alertCtrl.create({
title: title,
subTitle: messageAsString,
buttons: [ok],
enableBackdropDismiss: false
});
alert.present();
And for ion-select
// TS file
public selectOptions = { enableBackdropDismiss: false };
// html
<ion-item>
<ion-label >{{'LABEL_DATA' | translate}}</ion-label>
<ion-select [selectOptions]='selectOptions' [disabled]='data?.length == 0' #dataSel class='select-control' okText="{{'BUTTON_OK' | translate}}" cancelText="{{'BUTTON_CANCEL' | translate}}"
[ngModel]='selectedDataCode' (ionChange)='onDataChanged($event)'>
<ion-option *ngFor='let cdp of data' value="{{cdp.code}}">{{cdp.description}}</ion-option>
</ion-select>
</ion-item>
Hope that helps.