Hi all ! Could anyone suggest please is it possible ion-select close by choose value without click “Ok” ?
<ion-select [(ngModel)]="selectedType" (ionChange)="changePriceType()" *ngIf="shoppingCart>0">
<ion-option *ngFor="let item of shoppingCart; let i =index" value="{{i}}">
{{item.priceCaption}}
</ion-option>
</ion-select>
2 Likes
Hi @anton_klochko,
You can use below mentioned code for avoiding OK button and directly clicking on the option value
<ion-select [(ngModel)]="selectedType" interface="popover" (ionChange)="changePriceType()" *ngIf="shoppingCart>0">
<ion-option *ngFor="let item of shoppingCart; let i =index" value="{{i}}">
{{item.priceCaption}}
</ion-option>
</ion-select>
New thing is interface property of ion-select tag.
Hope this will resolve your issue.
8 Likes
addwebsolution, it is working … thanks !
i suggest using action-sheet. these two words remove ok button and when user click on a choice auto close the pop-up.
<ion-item>
<ion-label>Gender</ion-label>
<ion-select interface="action-sheet">
<ion-option value="f" selected="true">Female</ion-option>
<ion-option value="m">Male</ion-option>
</ion-select>
</ion-item>
source :https://stackoverflow.com/a/39015858/308578
2 Likes