OO.ui.ButtonMenuSelectWidget currently constructs its own menu (an OO.ui.MenuSelectWidget) in its constructor: https://gerrit.wikimedia.org/g/oojs/ui/+/1d4e6ba5e8f0d541dd847059eef271da469ae082/src/widgets/ButtonMenuSelectWidget.js#62
Since T261862, Special:Investigate uses an OO.ui.ButtonMenuSelectWidget with a custom menu with custom event handlers.
We did this by subclassing OO.ui.ButtonMenuSelectWidget and adding our custom menu widget in the constructor of this subclass.
A less fragile long-term solution would be to allow a custom menu to be passed to OO.ui.ButtonMenuSelectWidget.
Acceptance Criteria
- OO.ui.ButtonMenuSelectWidget adds a menu passed through the config. If none is passed, it behaves as before.