Page MenuHomePhabricator

OOUI icons do not always load
Closed, ResolvedPublicBUG REPORT

Description

Steps to Reproduce:

When attempting to add OOUI icons to buttons using JavaScript for a user script, I add the code:

var rollbackbutton = new OO.ui.ButtonWidget({
   autosize: true,
   label: 'Rollback',
   flags: [
      'primary',
      'progressive'
   ],
   icon: "editUndo",
   align: 'inline'
});
$(selector).append(rollbackbutton.$element);

in JavaScript, using the appropriate icon code from https://doc.wikimedia.org/oojs-ui/master/demos/?page=icons

Actual Results:

What happens is that the button loads with no icon at all. I double-checked my code for errors, and there are no errors whatsoever.

Expected Results:

The button should load with the icon "editUndo" next to it.

Event Timeline

Soda edited subscribers, added: Soda; removed: OOUI.Sep 14 2020, 3:43 AM

@Awesome_Aasim You would want to load oojs-ui.styles.icons-editing-core to use the editUndo icon.

@Soda that seemed to fix the issue, but it would be good if the documentation was updated to include that.

Soda claimed this task.

Added. Feel free to improve on it :)