Add support for disabled menu items.

Review Request #14421 — Created May 3, 2025 and submitted

Information

Ink
master

Reviewers

Menu items can now be marked as disabled. When disabled, they can still
be selected for menu navigation or on mouse over, but no actions will be
performed. Clicking or pressing Space or Enter will do nothing, and the
menu will remain open. This allows for accessible keyboard navigation
without risk of performing unwanted actions.

An internal change to state tracking had to be made. Previously,
#items tracked only menu items (no separators), but #itemViews
tracked all views (menu items and separators). This meant that an index
for one didn't apply to the other. We now keep those two consistent on
menu items, and track everything under #allItemViews.

Tested with a menu consisting of enabled and disabled menu items of
all types. Verified that I could select but could not invoke any disabled
item actions through any means.

Unit tests pass.

Summary ID
Add support for disabled menu items.
Menu items can now be marked as disabled. When disabled, they can still be selected for menu navigation or on mouse over, but no actions will be performed. Clicking or pressing Space or Enter will do nothing, and the menu will remain open. This allows for accessible keyboard navigation without risk of performing unwanted actions. An internal change to state tracking had to be made. Previously, `#items` tracked only menu items (no separators), but `#itemViews` tracked all views (menu items and separators). This meant that an index for one didn't apply to the other. We now keep those two consistent on menu items, and track everything under `#allItemViews`.
c2ffd5da8858107d755c2cb243c1e906fb236513

david
  1. Ship It!
  2. 
      
chipx86
Review request changed
Status:
Completed
Change Summary:
Pushed to master (05aa540)