EddyVerbruggen / cordova-plugin-actionsheet

:clipboard: ActionSheet plugin for Cordova iOS and Android apps
208 stars 71 forks source link

Improvement - Consider dinamically option changes #72

Open derek90 opened 4 years ago

derek90 commented 4 years ago

Right now, when you want to know what option was selected, you just have the index of it. If you need to remove or add options dinamically, checking some conditions before showing the component, you will need to repeat those conditions to know what the user picked up, because the index of the button won't be enough. An improvement for this could be that the result of the user interaction be wrapped in an object, with the index plus another info like the label text or may be a new field that could be added to the ActionSheetOptions object, to know exactly what the user chose, and not have to guess what options where shown to him to know what the index means.