feat: make disabled menu items accessible with feature flag#11541
Merged
Conversation
When the `accessibleDisabledMenuItems` feature flag is enabled, disabled
context-menu and menu-bar sub-menu items become focusable and hoverable,
while still preventing selection and sub-menu opening. This mirrors the
existing `accessibleDisabledButtons` flag for root-level menu-bar buttons.
window.Vaadin.featureFlags.accessibleDisabledMenuItems = true;
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Firefox can leave document.activeElement on <body> when calling element.focus() inside an overlay without any focusable element in the surrounding document, causing sendKeys to miss the focused item. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
web-padawan
reviewed
Apr 23, 2026
- Move "Disabled menu items" JSDoc from ItemsMixin to the vaadin-context-menu class JSDoc (both .js and .d.ts) for discoverability. - Mirror the "Disabled sub-menu items" JSDoc section in vaadin-menu-bar-mixin.d.ts. - Drop the unused global focusables from the menu-bar test fixture. - Keep one focusable sibling in the context-menu test fixture to work around a Firefox focus quirk, with an explanatory comment. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This was referenced Apr 23, 2026
web-padawan
reviewed
Apr 23, 2026
web-padawan
approved these changes
Apr 23, 2026
7b54992 to
f0f70d6
Compare
f0f70d6 to
18f7a62
Compare
|
web-padawan
approved these changes
Apr 23, 2026
This was referenced Apr 24, 2026
isipkh110
pushed a commit
to isipkh110/flow-components
that referenced
this pull request
Apr 28, 2026
## Description Follow-up to vaadin/web-components#11541, which introduced the `accessibleDisabledMenuItems` feature flag making disabled context-menu and menu-bar sub-menu items focusable and hoverable while still preventing selection and sub-menu opening. This PR registers the flag on the Flow side so users can opt in by adding the following to `src/main/resources/vaadin-featureflags.properties`: ``` com.vaadin.experimental.accessibleDisabledMenuItems = true ``` The flag is registered via a new `AccessibleDisabledMenuItemsFeatureFlagProvider` in the `vaadin-context-menu-flow` module. `vaadin-menu-bar-flow` picks it up transitively via its existing dependency on context-menu-flow, so a single registration covers both components. Also refreshes the `Button`, `MenuItem`, and `MenuBarItem` `setEnabled` JSDocs to mirror the shorter wording used in the web-components PR. The `MenuBarItem` doc now covers both `accessibleDisabledButtons` (for root-level items) and `accessibleDisabledMenuItems` (for sub-menu items). ## Type of change - Feature --------- Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Collaborator
|
This ticket/PR has been released with Vaadin 25.2.0-alpha4. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



Description
This is the first part of the work to improve accessibility of disabled menu items. It introduces a new feature flag
accessibleDisabledMenuItemsthat makes disabled context-menu and menu-bar sub-menu items focusable and hoverable, while still preventing selection and sub-menu opening. Tooltip support for disabled menu items will be added in a follow-up PR.Part of #10415
Type of change
🤖 Partially generated with Claude Code