Closed hirbod closed 8 years ago
Hi, this is on Android, right?
Sorry, forgot to mention. It's on iOS
According to this SO answer that should be possible. I hope to add a preference soon.
This would be perfect. It would be awesome to also provide something like
destructiveButtonIndex = integer or destructiveButtonIndex = "first"; (default) destructiveButtonIndex = "last";
This would save us time calculating the offset (just a nice to have, as ActionSheets usally dont have more then 3-5 items.
I'm refactoring the iOS code as we speak because I'm using a class that's been deprecated since iOS8.. and with iOS10 on our doorstep I don't have an excuse not to move on. I will try to maintain backward compat with iOS7 and lower though.
Note that the appearance of the ActionSheet will not change for iOS, it's mostly an internal thingy in iOS' codebase.
@Hirbod I'll take that request into account and provide a new destructiveButtonLast
boolean property which is default false
so it's the same as it is now (per your suggestion).
Available in 2.3.0 on all platforms. See the updated example in the readme (look for destructiveButtonLast
).
Wow.. this was, again, @EddyVerbruggen light speed development. Guess I will send some beer again.
Good. My stock dried up in the meanwhile! Cheers mate 🍻
@EddyVerbruggen while the combination with destructiveButtonLast works pretty good, single ActionSheets (with just one option) don't work anymore on 2.3.0. I don't even receive an error or something. I will try to find out if "destructiveButtonLast" is causing this or not.
Identified the bug.
var options = {
'buttonLabels': [$scope.trans.BLOCKED_NEIGHBORS],
'addCancelButtonWithLabel': $scope.trans.ABORT,
'androidEnableCancelButton': true, // default false
'winphoneEnableCancelButton': true, // default false
};
window.plugins.actionsheet.show(options, function(index) {
alert(index);
switch (index) {
case 1:
appNavigator.pushPage('blocked_user.html', {
animation: 'lift'
});
break;
}
});
will return 2 as index, while it should be 1 (worked before updating to 2.3.0)
OMG I didn't test that case. Let me do so (4 platforms to test really).
Just tested on iOS 9.3. Will fire up Android now and tell you my results
Seems like iOS is the only platform with the issue..
Confirmed. Android is working as expected.
2.3.0 is dead, long live 2.3.1, thanks for the quick test!
Confirmed! it works! Thank you very much
How can I get the action sheet to work in iOS?
Hi @EddyVerbruggen,
the destructive button is always on first position, even when added later to the options array. Is there any way to decide where to show it? Or at least to put it at bottom?