Add RB.MenuView, a common JavaScript view for menus.
Review Request #10906 — Created Feb. 18, 2020 and submitted
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
.
Description | From | Last Updated |
---|---|---|
Col: 65 Missing semicolon. |
reviewbot | |
Col: 61 Missing semicolon. |
reviewbot | |
Col: 68 Missing semicolon. |
reviewbot | |
Col: 67 Missing semicolon. |
reviewbot | |
Shouldn't this be number? Probably want to list the enumerations here like they are in the docs for initialize too. |
david | |
We should put a cross-reference there too. Even better would be if the JS could introspect the element CSS and … |
david | |
Can you print what the invalid value was? |
david | |
There's nothing dynamic about this--why not just put it in the HTML inside $()? |
david | |
Missing "Args:" |
david | |
Missing "Args:" |
david |
- Change Summary:
-
Fixed some missing semicolons.
- Commit:
-
0701e1ea17cfd0febcfeeb4c53b123af55a71d53b79c2757899b772200314c32566bb551610618d1
Checks run (2 succeeded)
- Change Summary:
-
- Mouse movements over menu items now changes focus to that item, meaning that mouse and keyboard no longer fight over visual selection.
- Fleshed out documentation.
- Made some attributes private.
- Commit:
-
b79c2757899b772200314c32566bb551610618d15283fcfc37c7ed202a204f31bfbce0164025cd5b
Checks run (2 succeeded)
- Change Summary:
-
- Fixed some missing/incorrect bits of documentation.
- Fixed some logging to show the incorrect menu type, when provided.
- Simplified button menu item construction to provide
type="button"
during initial construction.
- Commit:
-
5283fcfc37c7ed202a204f31bfbce0164025cd5b360ed51334a35a68c4957ba3e4f204e003849bd8