Page MenuHomePhabricator

MenuTagMultiselectWidget does not support icons in menu
Closed, ResolvedPublic1 Estimated Story Points

Description

The menu items in MenuTagMultiselectWidget could theoretically support icons but does not in the current implementation. Example code which I expect to generate menu items with icons:

var widget =  new OO.ui.MenuTagMultiselectWidget( {
    options: [
        {
            data: 'user',
            label: ' User Namespace',
            icon: 'userAvatar'
        }
    ]
} );

A workaround, for now, is to subclass MenuTagMultiselectWidget and either
a) override createMenuOptionWidget (with a lookup mechanism data => icon)
b) override both addOptions and createMenuOptionWidget to use the full extent of available menu item config options

Event Timeline

Change 435806 had a related patch set uploaded (by VolkerE; owner: VolkerE):
[oojs/ui@master] MenuTagMultiselectWidget: Allow icons in dropdown menus

https://gerrit.wikimedia.org/r/435806

Change 435806 merged by jenkins-bot:
[oojs/ui@master] MenuTagMultiselectWidget: Allow icons in dropdown menus

https://gerrit.wikimedia.org/r/435806

Volker_E claimed this task.
Volker_E triaged this task as Low priority.
Volker_E moved this task from Reviewing to OOUI-0.27.2 on the OOUI board.
Volker_E edited projects, added OOUI (OOUI-0.27.2); removed OOUI.
Volker_E removed a project: Patch-For-Review.
Volker_E removed a subscriber: gerritbot.
Jdforrester-WMF added a subscriber: Jdforrester-WMF.

This was released in OOUI v0.27.2, which will roll out with MediaWiki 1.32.0-wmf.8.