Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-27854] Android: Ti.UI.OptionDialog "options" are not honored if "message" is set

GitHub Issuen/a
TypeBug
PriorityNone
StatusOpen
ResolutionUnresolved
Affected Version/sn/a
Fix Version/sn/a
ComponentsAndroid
Labelsn/a
ReporterHans Knöchel
AssigneeUnknown
Created2020-04-19T20:15:06.000+0000
Updated2020-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.

Comments

  1. Joshua Quick 2020-04-21

    This is an undocumented feature. Our OptionDialog doesn'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. :-/

JSON Source