Ionic select remove ok button and on tap over option value straight away


#1

Hi,

When a user has to select a valid value, he/she has to select the value
then press OK.
Could we remove the OK button and consider that if the user selects a
value, then it is confirming the new value straight away? It will remove
one tap.

Thanks


#2

i need it too! Help us!


#3

add an id in your button or any things and remove it in your angular function , example :

in html :

<button #but (click)="delete(but)" >OK</button>

in angular :

 delete(Button: Element) {
    Button.remove();
  }

#4

Please do not take the advice in the previous post.

To OP: use either the action-sheet or popover interfaces documented here:

The action-sheet and popover interfaces do not have an OK button, clicking on any of the options will automatically close the overlay and select that value.


#5

For some reason the popover interface isn’t working for me (I still have the OK, Cancel buttons):

	<ion-select interface="popover" [(ngModel)]="selectedPeriodId" (ionChange)="onPeriodChange()">
		<ion-option *ngFor="let period of periods" [value]="period.id">{{period.name}}</ion-option>
	</ion-select>

#6

what about interface=“action-sheet” it is worked for me