Skip to content

onejs-ui: in-menu keyboard navigation for Select / DropdownMenu #110

Description

@Singtaa

Summary

onejs-ui's Select and DropdownMenu are currently pointer-driven: the menu opens, flips/shifts, and dismisses on outside-press or Escape, but in-menu keyboard navigation is not wired — you can't arrow through the options or Enter to choose with the keyboard once the menu is open.

This is the in-menu nav follow-up; it's distinct from the focus-visible ring work (the menu trigger already participates in the focus-visible system).

Desired behavior

When an open Select / DropdownMenu has focus:

  • Up/Down (and gamepad d-pad) move an active/highlighted option, wrapping at the ends.
  • Enter / Space commit the highlighted option (and close).
  • Escape closes without committing (already works).
  • Highlight uses the same focus-visible ring treatment as the rest of the library.

Notes

  • Files: JSModules/onejs-ui/src/components/Select/Select.tsx, .../DropdownMenu/DropdownMenu.tsx.
  • The menu is portaled/anchored, so it should establish a FocusScope (autofocus the active item, trap, restore to the trigger on close) and drive option focus via the existing focus utilities.
  • Replaces an earlier incorrect in-code reference to Runtime focus: pointer↔navigation focus desync corrupts the focus ring (UI Toolkit + Input System) #108 (which is an unrelated, closed focus-ring-desync issue); the code comments now point here.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions