Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Menu Bar, Menu Button, Menu, and Menu Items #42

Open
wants to merge 291 commits into
base: develop
Choose a base branch
from

Conversation

charlie-yao
Copy link
Owner

@charlie-yao charlie-yao commented Dec 28, 2021

  • Menu
  • Menubar
  • Menu Button
  • Menuitem
  • Parent Menuitem
  • Menuitem Checkbox
  • Menuitem Radio
  • Separator

https://www.w3.org/TR/wai-aria-practices-1.1/#menu
https://www.w3.org/TR/wai-aria-practices-1.1/examples/menubar/menubar-1/menubar-1.html
https://www.w3.org/TR/wai-aria-practices-1.1/examples/menubar/menubar-2/menubar-2.html

https://www.w3.org/TR/wai-aria-practices-1.1/#menubutton
https://www.w3.org/TR/wai-aria-practices-1.1/examples/menu-button/menu-button-links.html
https://www.w3.org/TR/wai-aria-practices-1.1/examples/menu-button/menu-button-actions.html
https://www.w3.org/TR/wai-aria-practices-1.1/examples/menu-button/menu-button-actions-active-descendant.html

https://www.w3.org/TR/wai-aria-1.1/#menu
https://www.w3.org/TR/wai-aria-1.1/#menubar
https://www.w3.org/TR/wai-aria-1.1/#menuitem
https://www.w3.org/TR/wai-aria-1.1/#menuitemcheckbox
https://www.w3.org/TR/wai-aria-1.1/#menuitemradio
https://www.w3.org/TR/wai-aria-1.1/#separator

TODO:

  • differentiate between "base-level" aria components and opinionated stuff? (e.g. pure functional components that help us know what aria/html attributes to add by using proptypes vs logic/state layer vs CSS/cosmetics layer)
    • demo (e.g. styled, stateful, etc.) vs opinionated (handles refs and events and methods) vs base (functional components that are totally unopinionated)
    • opinionated layer accepts components as props that provide styling? demos provide these components? possibly better than specifying classname/styles/component when defining the items array - no need to repeat the same thing for every item, avoid possible confusion as to where a classname should be applied if it's a more complex component like ParentMenuItem, etc.
    • provide styling for any (?) expanded menu/sub-menu
  • finish implementing state/focus management
    • account for menu orientation
    • how to handle state changes and item activation (isDisabled, isChecked, etc.)?
    • how to handle index-based focusing when accounting for "separator" (part of items array but not focusable) and "radiogroup" (part of items array but has children)?
    • disable onActivate if, well, disabled
    • better abstractions for state and focus management
      • rework navigation/focus API?
        • combine focusmenubaritem props?
        • how should parentmenuitem know if it's a child of a menubar or a menubutton? (account for root navigation?)
        • how necessary is flattenedPosition? do we need distinct radiogroups? what are the actual semantics of grouping? (e.g. is it possible for radio options to refer to a group via some aria attribute rather than being children of a role="group"?) flattenedPosition may be necessary to an extent - possibly don't need the full position, just the index, flattened index, and root flattened index
      • consolidate rendering code?
      • consolidate events?
        • since events can bubble, possibly split up responsibilities between items and parent menus? or use another abstraction?
      • consolidate focus/navigation code?
        • possible to consolidate methods like focus() or focusFirstChild()? offload methods to a HOC?
    • mouse behavior
  • components
    • menu button
    • menubar
    • menu
    • menuitem
    • parent menuitem
    • menuitemcheckbox
    • menuitemradio
    • menuitemradiogroup
    • separator
  • demo menubar
  • demo menubar with different orientations
  • demo menubutton
  • demo menubutton with different orientations
  • organize comments, proptypes, etc. be mindful of labeling requirements and document them.

Before Merging:

Won't Do (for now):

  • activate upon something like shift + F10
  • focus on items when entering a printable character
  • worry about sorting/filtering/etc. menu items
  • navigation-focused behavior
  • rendering optimization

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant