[TIMOB-27854] Android: Ti.UI.OptionDialog "options" are not honored if "message" is set
| GitHub Issue | n/a |
|---|---|
| Type | Bug |
| Priority | None |
| Status | Open |
| Resolution | Unresolved |
| Affected Version/s | n/a |
| Fix Version/s | n/a |
| Components | Android |
| Labels | n/a |
| Reporter | Hans Knöchel |
| Assignee | Unknown |
| Created | 2020-04-19T20:15:06.000+0000 |
| Updated | 2020-04-21T04:05:37.000+0000 |
Description
If I set both the
message and options parameter of the Ti.UI.OptionDialog, the options are not displayed:
const options = Ti.UI.createOptionDialog({
title: 'My title',
message: 'My message',
options: ['Yes', 'No'],
cancel: 1
});
options.show();
The same works fine on iOS and represents a UX and parity issue for us.
This is an undocumented feature. Our
OptionDialogdoesn't mention "message" support. https://docs.appcelerator.com/platform/latest/#!/api/Titanium.UI.OptionDialog And we probably don't document it because this is a native limitation on Google's end. You can either have a message or an item list, but not both. The only other way to do this is to set up a custom view within the dialog, but most native Android devs ditch the message and just use the title instead. https://developer.android.com/guide/topics/ui/dialogs.html {quote} *Quote from Google:* Because the list appears in the dialog's content area, the dialog cannot show both a message and a list and you should set a title for the dialog with setTitle(). {quote} I do agree that the lack of parity here isn't great. The only way for us to solve it is to use a custom view within the dialog. :-/