Skip to content

Commit 18f7a62

Browse files
committed
update JSDoc
1 parent e5ff71d commit 18f7a62

6 files changed

Lines changed: 48 additions & 76 deletions

File tree

packages/button/src/vaadin-button.d.ts

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -55,16 +55,14 @@ import { ButtonMixin } from './vaadin-button-mixin.js';
5555
*/
5656
declare class Button extends ButtonMixin(ElementMixin(ThemableMixin(HTMLElement))) {
5757
/**
58-
* When disabled, the button is rendered as "dimmed" and prevents all
59-
* user interactions (mouse and keyboard).
58+
* When disabled, the button is rendered as "dimmed".
6059
*
61-
* Since disabled buttons are not focusable and cannot react to hover
62-
* events by default, it can cause accessibility issues by making them
63-
* entirely invisible to assistive technologies, and prevents the use
64-
* of Tooltips to explain why the action is not available. This can be
65-
* addressed by enabling the feature flag `accessibleDisabledButtons`,
60+
* By default, disabled buttons are not focusable and don't react to hover.
61+
* As a result, they are hidden from assistive technologies, and it's not
62+
* possible to show a tooltip to explain why they are disabled. This can
63+
* be addressed by enabling the feature flag `accessibleDisabledButtons`,
6664
* which makes disabled buttons focusable and hoverable, while still
67-
* preventing them from being triggered:
65+
* preventing them from being activated:
6866
*
6967
* ```js
7068
* // Set before any button is attached to the DOM.

packages/button/src/vaadin-button.js

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -77,16 +77,14 @@ class Button extends ButtonMixin(ElementMixin(ThemableMixin(PolylitMixin(LumoInj
7777
static get properties() {
7878
return {
7979
/**
80-
* When disabled, the button is rendered as "dimmed" and prevents all
81-
* user interactions (mouse and keyboard).
80+
* When disabled, the button is rendered as "dimmed".
8281
*
83-
* Since disabled buttons are not focusable and cannot react to hover
84-
* events by default, it can cause accessibility issues by making them
85-
* entirely invisible to assistive technologies, and prevents the use
86-
* of Tooltips to explain why the action is not available. This can be
87-
* addressed by enabling the feature flag `accessibleDisabledButtons`,
82+
* By default, disabled buttons are not focusable and don't react to hover.
83+
* As a result, they are hidden from assistive technologies, and it's not
84+
* possible to show a tooltip to explain why they are disabled. This can
85+
* be addressed by enabling the feature flag `accessibleDisabledButtons`,
8886
* which makes disabled buttons focusable and hoverable, while still
89-
* preventing them from being triggered:
87+
* preventing them from being activated:
9088
*
9189
* ```js
9290
* // Set before any button is attached to the DOM.

packages/context-menu/src/vaadin-context-menu.d.ts

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -108,16 +108,14 @@ export interface ContextMenuEventMap<TItem extends ContextMenuItem = ContextMenu
108108
*
109109
* #### Disabled menu items
110110
*
111-
* When disabled, menu items are rendered as "dimmed" and prevent all
112-
* user interactions (mouse and keyboard).
113-
*
114-
* Since disabled items are not focusable and cannot react to hover
115-
* events by default, it can cause accessibility issues by making them
116-
* entirely invisible to assistive technologies, and prevents the use
117-
* of Tooltips to explain why the action is not available. This can be
118-
* addressed by enabling the feature flag `accessibleDisabledMenuItems`,
111+
* When disabled, menu items are rendered as "dimmed".
112+
*
113+
* By default, disabled items are not focusable and don't react to hover.
114+
* As a result, they are hidden from assistive technologies, and it's not
115+
* possible to show a tooltip to explain why they are disabled. This can
116+
* be addressed by enabling the feature flag `accessibleDisabledMenuItems`,
119117
* which makes disabled items focusable and hoverable, while still
120-
* preventing them from being triggered:
118+
* preventing them from being activated:
121119
*
122120
* ```js
123121
* // Set before any context menu is attached to the DOM.

packages/context-menu/src/vaadin-context-menu.js

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -56,16 +56,14 @@ import { ContextMenuMixin } from './vaadin-context-menu-mixin.js';
5656
*
5757
* #### Disabled menu items
5858
*
59-
* When disabled, menu items are rendered as "dimmed" and prevent all
60-
* user interactions (mouse and keyboard).
61-
*
62-
* Since disabled items are not focusable and cannot react to hover
63-
* events by default, it can cause accessibility issues by making them
64-
* entirely invisible to assistive technologies, and prevents the use
65-
* of Tooltips to explain why the action is not available. This can be
66-
* addressed by enabling the feature flag `accessibleDisabledMenuItems`,
59+
* When disabled, menu items are rendered as "dimmed".
60+
*
61+
* By default, disabled items are not focusable and don't react to hover.
62+
* As a result, they are hidden from assistive technologies, and it's not
63+
* possible to show a tooltip to explain why they are disabled. This can
64+
* be addressed by enabling the feature flag `accessibleDisabledMenuItems`,
6765
* which makes disabled items focusable and hoverable, while still
68-
* preventing them from being triggered:
66+
* preventing them from being activated:
6967
*
7068
* ```js
7169
* // Set before any context menu is attached to the DOM.

packages/menu-bar/src/vaadin-menu-bar-mixin.d.ts

Lines changed: 11 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -101,35 +101,25 @@ export declare class MenuBarMixinClass<TItem extends MenuBarItem = MenuBarItem>
101101
* ];
102102
* ```
103103
*
104-
* #### Disabled buttons
104+
* #### Disabled items
105105
*
106-
* When disabled, menu bar buttons (root-level items) are rendered
107-
* as "dimmed" and prevent all user interactions (mouse and keyboard).
106+
* When disabled, menu bar items are rendered as "dimmed".
108107
*
109-
* Since disabled buttons are not focusable and cannot react to hover
110-
* events by default, it can cause accessibility issues by making them
111-
* entirely invisible to assistive technologies, and prevents the use
112-
* of Tooltips to explain why the action is not available. This can be
113-
* addressed by enabling the feature flag `accessibleDisabledButtons`,
114-
* which makes disabled buttons focusable and hoverable, while still
115-
* preventing them from being triggered:
108+
* By default, disabled items are not focusable and don't react to hover.
109+
* As a result, they are hidden from assistive technologies, and it's not
110+
* possible to show a tooltip to explain why they are disabled. This can be
111+
* addressed by enabling several feature flags, which makes disabled items
112+
* focusable and hoverable, while still preventing them from being activated:
116113
*
117114
* ```js
118-
* // Set before any menu bar is attached to the DOM.
115+
* // Allow focus and hover interactions with disabled menu bar root items (buttons)
119116
* window.Vaadin.featureFlags.accessibleDisabledButtons = true;
120-
* ```
121-
*
122-
* #### Disabled sub-menu items
123-
*
124-
* Likewise, disabled sub-menu items are not focusable or hoverable
125-
* by default. Enabling the feature flag `accessibleDisabledMenuItems`
126-
* makes them focusable and hoverable, while still preventing them
127-
* from being triggered:
128117
*
129-
* ```js
130-
* // Set before any menu bar is attached to the DOM.
118+
* // Allow focus and hover interactions with disabled menu bar sub-menu items
131119
* window.Vaadin.featureFlags.accessibleDisabledMenuItems = true;
132120
* ```
121+
*
122+
* Both flags must be set before any menu bar is attached to the DOM.
133123
*/
134124
items: TItem[];
135125

packages/menu-bar/src/vaadin-menu-bar-mixin.js

Lines changed: 11 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -123,36 +123,26 @@ export const MenuBarMixin = (superClass) =>
123123
* ];
124124
* ```
125125
*
126-
* #### Disabled buttons
126+
* #### Disabled items
127127
*
128-
* When disabled, menu bar buttons (root-level items) are rendered
129-
* as "dimmed" and prevent all user interactions (mouse and keyboard).
128+
* When disabled, menu bar items are rendered as "dimmed".
130129
*
131-
* Since disabled buttons are not focusable and cannot react to hover
132-
* events by default, it can cause accessibility issues by making them
133-
* entirely invisible to assistive technologies, and prevents the use
134-
* of Tooltips to explain why the action is not available. This can be
135-
* addressed by enabling the feature flag `accessibleDisabledButtons`,
136-
* which makes disabled buttons focusable and hoverable, while still
137-
* preventing them from being triggered:
130+
* By default, disabled items are not focusable and don't react to hover.
131+
* As a result, they are hidden from assistive technologies, and it's not
132+
* possible to show a tooltip to explain why they are disabled. This can be
133+
* addressed by enabling several feature flags, which makes disabled items
134+
* focusable and hoverable, while still preventing them from being activated:
138135
*
139136
* ```js
140-
* // Set before any menu bar is attached to the DOM.
137+
* // Allow focus and hover interactions with disabled menu bar root items (buttons)
141138
* window.Vaadin.featureFlags.accessibleDisabledButtons = true;
142-
* ```
143-
*
144-
* #### Disabled sub-menu items
145-
*
146-
* Likewise, disabled sub-menu items are not focusable or hoverable
147-
* by default. Enabling the feature flag `accessibleDisabledMenuItems`
148-
* makes them focusable and hoverable, while still preventing them
149-
* from being triggered:
150139
*
151-
* ```js
152-
* // Set before any menu bar is attached to the DOM.
140+
* // Allow focus and hover interactions with disabled menu bar sub-menu items
153141
* window.Vaadin.featureFlags.accessibleDisabledMenuItems = true;
154142
* ```
155143
*
144+
* Both flags must be set before any menu bar is attached to the DOM.
145+
*
156146
* @type {!Array<!MenuBarItem>}
157147
*/
158148
items: {

0 commit comments

Comments
 (0)