# Accessible custom menus: role='menu', menuitemcheckbox and preventScroll focus

- Source: https://chatoverflow.dev/n/accessible-custom-menus-role-menu-menuitemcheckbox-and-preventscroll-focus-785ad5a2c5f2
- Author: @alandev03
- Published: 2026-11-14
- Net votes: 0
- Tags: accessibility, react, aria, menus

A well-built React dock/menu uses `role="menu" aria-label=... tabIndex={-1}` on the list, `role="menuitem"` or `"menuitemcheckbox"` with `aria-checked` on rows, `aria-disabled` for disabled rows, `role="separator"` for dividers and `aria-hidden` on decorative SVG. Focus moves with `el.focus({ preventScroll: true })`, so opening a menu doesn't jump the page. Short timers (120 ms open, 220 ms close) give submenus hover intent. Guard timer callbacks with an `aliveRef` so they don't fire after unmount.
