Hi there!
Does anybody know if it’s possible to auto-close a select alert when user select a value, same as if you tap “OK” button?
The purpose is simply to be able to select a value in 1 tap and make UI more reactive
Thanks!
Hi there!
Does anybody know if it’s possible to auto-close a select alert when user select a value, same as if you tap “OK” button?
The purpose is simply to be able to select a value in 1 tap and make UI more reactive
Thanks!
IMHO it would be weird to provide “OK” button if you want to auto-close when user selects a value. Because user would never get a chance to click “OK” button. I think you should use interface="action-sheet"
instead of default alert behavior.
See below plunker for demo
http://embed.plnkr.co/hTHcLfZ3IZRmOOSKH3XP/
<ion-list>
<ion-item>
<ion-label>Gaming</ion-label>
<ion-select [(ngModel)]="gaming" interface="action-sheet">
<ion-option value="nes">NES</ion-option>
<ion-option value="n64">Nintendo64</ion-option>
<ion-option value="ps">PlayStation</ion-option>
<ion-option value="genesis">Sega Genesis</ion-option>
<ion-option value="saturn">Sega Saturn</ion-option>
<ion-option value="snes">SNES</ion-option>
</ion-select>
</ion-item>
</ion-list>
Yes, you’re right.
Actually, I didn’t know about the action-sheet interface.
That looks like a good solution for me.
Thanks for sharing!