Add RB.MenuView, a common JavaScript view for menus.
Review Request #10906 — Created Feb. 19, 2020 and submitted — Latest diff uploaded
This provides a standard menu implementation that we can use any time we
need a menu. It supports dynamically adding items and opening/closing
the menu (with and without animation).All accessibility needs are covered by this class. It handles setting
the appropriate ARIA roles on the menu, menu items, and the controlling
element that opens the menu. It also handles full keyboard navigation,
allowing the menu to be interacted with entirely by keyboard.Unit tests cover all the rendering options, focus management, ARIA
attributes/states, and keyboard accessibility available in this
component.
Unit tests passed.
Used this with an upcoming change that updates
RB.SplitButtonView
to
useRB.MenuView
.