Skip to content
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Document item roles, reveal-on-open, and the selected tint in the README
The ARIA attributes section covered the trigger, body, submenu, and
menubar annotations but not the item-level ones added alongside them:
option/menuitem role fill-in, the presentation role on list wrappers,
aria-selected on the current listbox option, and the reveal-on-open
behavior with its --uktdd-body-bg-color-selected custom property.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01HcJxNoQKN6Yx5hmYpwJHMJ
  • Loading branch information
claude committed Jul 16, 2026
commit c48606ac39d3d967e247c1325029dee2f4f3efa3
15 changes: 15 additions & 0 deletions packages/dropdown/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -947,6 +947,21 @@ readers can associate the trigger with its popup. If your custom trigger
already specifies any of these ARIA props, your values win — the component
only fills in what you haven’t set.

Item roles are filled in the same way when the body opens: items receive
`role="option"` in a searchable (listbox) dropdown or `role="menuitem"` in
a menu (always `menuitem` inside a submenu), and the `<ul>`/`<ol>` wrappers
around them receive `role="presentation"` so the listbox or menu owns its
items directly rather than through an intervening list. A natively
interactive item (a button, link, or input) or one with a role you set
yourself keeps its own role.

Opening also reveals the current selection: the item matching `props.value`
becomes the active item (so keyboard navigation starts from the current
selection) and is scrolled into view. In a searchable (listbox) dropdown it
additionally receives `aria-selected="true"` (`aria-selected` isn’t valid
on a `menuitem`); the persistent tint on the selected item is themeable via
the `--uktdd-body-bg-color-selected` custom property.

Submenus and menubars extend the same pattern automatically:

- parent items receive `aria-haspopup="menu"` and `aria-expanded`, and
Expand Down
Loading