Nativescript: Dialogs.action -> add index

Created on 26 Sep 2017  路  3Comments  路  Source: NativeScript/NativeScript

When using a dynamic action dialog, it'd be helpful if the selected action index would also be returned


Want to back this issue? Post a bounty on it! We accept bounties via Bountysource.

feature help wanted low

Most helpful comment

Hi! Yes, that's what I'm doing right now:

action(options).then((result) => {
    let found = actions.find((a) => { return a.name == result });
});

I just though it'd be nice to have the index or id too. For translated labels it might be a pain. Although duplicate action labels should never happen ux-wise

All 3 comments

Hey, @jrz, indeed the promise returns only the selected action, but you can easily implement your own logic to know the index of the selected action (for example by using an identical array to get the index).

Hi! Yes, that's what I'm doing right now:

action(options).then((result) => {
    let found = actions.find((a) => { return a.name == result });
});

I just though it'd be nice to have the index or id too. For translated labels it might be a pain. Although duplicate action labels should never happen ux-wise

Hey @jrz the solution you are using is easy enough to implement, so I think this is not a must-have feature.
However, NativeScript is an open source framework, and community contributors are more than welcome!
Anyone interested in this feature can create a PR following the contributing guidelines here

Was this page helpful?
0 / 5 - 0 ratings

Related issues

NordlingDev picture NordlingDev  路  3Comments

dhanalakshmitawwa picture dhanalakshmitawwa  路  3Comments

hshristov picture hshristov  路  3Comments

guillaume-roy picture guillaume-roy  路  3Comments

NickIliev picture NickIliev  路  3Comments