Skip to content

Commit

Permalink
rename feature flag, update JSDoc
Browse files Browse the repository at this point in the history
  • Loading branch information
vursen committed Jan 20, 2025
1 parent 17b7e4f commit 4f653bd
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 12 deletions.
9 changes: 5 additions & 4 deletions packages/menu-bar/src/vaadin-menu-bar-mixin.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -103,16 +103,17 @@ export declare class MenuBarMixinClass {
* #### Disabled items
*
* When an item is disabled, it prevents any user interaction with it, such as
* focusing, clicking, or opening a sub-menu.
* focusing, clicking, opening a sub-menu, etc. The item is also removed from the
* tab order, which may negatively impact accessibility.
*
* To improve accessibility, disabled root-level items (menu bar buttons) can be
* made focusable so that screen readers can reach and properly announce them to
* users. Other interactions such as clicks remain disabled. This behavior is
* currently experimental and can be enabled with the feature flag:
* users, while still preventing clicks. This is currently available as an
* experimental enhancement that can be enabled with the following feature flag:
*
* ```
* // Set before any menu bar is attached to the DOM.
* window.Vaadin.featureFlags.focusableDisabledComponents = true
* window.Vaadin.featureFlags.accessibleDisabledButtons = true;
* ```
*/
items: MenuBarItem[];
Expand Down
9 changes: 5 additions & 4 deletions packages/menu-bar/src/vaadin-menu-bar-mixin.js
Original file line number Diff line number Diff line change
Expand Up @@ -81,16 +81,17 @@ export const MenuBarMixin = (superClass) =>
* #### Disabled items
*
* When an item is disabled, it prevents any user interaction with it, such as
* focusing, clicking, or opening a sub-menu.
* focusing, clicking, opening a sub-menu, etc. The item is also removed from the
* tab order, which may negatively impact accessibility.
*
* To improve accessibility, disabled root-level items (menu bar buttons) can be
* made focusable so that screen readers can reach and properly announce them to
* users. Other interactions such as clicks remain disabled. This behavior is
* currently experimental and can be enabled with the feature flag:
* users, while still preventing clicks. This is currently available as an
* experimental enhancement that can be enabled with the following feature flag:
*
* ```
* // Set before any menu bar is attached to the DOM.
* window.Vaadin.featureFlags.focusableDisabledComponents = true
* window.Vaadin.featureFlags.accessibleDisabledButtons = true;
* ```
*
* @type {!Array<!MenuBarItem>}
Expand Down
4 changes: 2 additions & 2 deletions packages/menu-bar/test/focusable-disabled-buttons.common.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,11 @@ describe('focusable disabled buttons', () => {

before(() => {
window.Vaadin.featureFlags ??= {};
window.Vaadin.featureFlags.focusableDisabledComponents = true;
window.Vaadin.featureFlags.accessibleDisabledButtons = true;
});

after(() => {
window.Vaadin.featureFlags.focusableDisabledComponents = false;
window.Vaadin.featureFlags.accessibleDisabledButtons = false;
});

beforeEach(async () => {
Expand Down
4 changes: 2 additions & 2 deletions test/integration/menu-bar-tooltip.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -355,11 +355,11 @@ describe('menu-bar with tooltip', () => {
describe('focusable disabled button', () => {
before(() => {
window.Vaadin.featureFlags ??= {};
window.Vaadin.featureFlags.focusableDisabledComponents = true;
window.Vaadin.featureFlags.accessibleDisabledButtons = true;
});

after(() => {
window.Vaadin.featureFlags.focusableDisabledComponents = false;
window.Vaadin.featureFlags.accessibleDisabledButtons = false;
});

beforeEach(async () => {
Expand Down

0 comments on commit 4f653bd

Please sign in to comment.