Add RB.MenuButtonView, for creating single or split buttons with menus.
Review Request #10907 — Created Feb. 19, 2020 and submitted
This introduces a new
RB.MenuButtonViewcomponent, which uses the new
.rb-c-menu-buttonCSS component. This offers the ability to create a
single button that works as a drop-down menu, or a split button that has
a primary action and a separate drop-down button.
This is the successor to
RB.SplitButtonView, which is now deprecated.
There are still differences, in that
specifying IDs on menu items, but as that's not entirely useful in
practice, the functionality has not been carried over.
This improves upon
RB.SplitButtonViewin plenty of other ways. It can
now function in a split mode or in a single-button mode. It has ARIA
attributes and keyboard navigation (though
inherits this). It also now smartly pops the menus either above or below
the button depending on space, rather than having to provide that detail
Unit tests cover the majority of the rendering, accessibility, and
RB.MenuButtonViewin single-button and split-button modes.
Tested all mouse and keyboard navigation.
Tested legacy usage of
Checked the elements in the ARIA tree to make sure they appeared sane.
Unit tests pass.
Removed leftover debug output.
Revision 2 (+524 -188)
Checks run (1 failed, 1 succeeded)
Removed an unused variable.
Revision 3 (+521 -188)
Checks run (2 succeeded)