Skip to content

Commit 83b1731

Browse files
committed
improve JSDoc to better highlight tooltip case
1 parent bbb77ed commit 83b1731

File tree

2 files changed

+24
-16
lines changed

2 files changed

+24
-16
lines changed

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

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -100,16 +100,20 @@ export declare class MenuBarMixinClass {
100100
* ];
101101
* ```
102102
*
103-
* #### Disabled items
103+
* #### Disabled buttons
104104
*
105-
* When an item is disabled, it prevents any user interaction with it, such as
106-
* focusing, clicking, opening a sub-menu, etc. The item is also removed from
107-
* tab order, which makes it inaccessible to screen readers.
105+
* When a root-level item (menu bar button) is disabled, it prevents all user
106+
* interactions with it, such as focusing, clicking, opening a sub-menu, etc.
107+
* The button is also removed from tab order, which makes it unreachable via
108+
* the keyboard navigation.
108109
*
109-
* To improve accessibility, disabled root-level items (menu bar buttons) can be
110-
* made focusable so that screen readers can still reach and properly announce
111-
* them, while still preventing clicks. This is currently available as an
112-
* experimental enhancement that can be enabled with the following feature flag:
110+
* While the default behavior effectively prevents accidental interactions,
111+
* it has an accessibility drawback: screen readers skip disabled buttons
112+
* entirely, and users can't see tooltips that might explain why the button
113+
* is disabled. To address this, an experimental enhancement allows disabled
114+
* menu bar buttons to receive focus and show tooltips, while still preventing
115+
* other interactions. This feature can be enabled with the following feature
116+
* flag:
113117
*
114118
* ```
115119
* // Set before any menu bar is attached to the DOM.

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

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -78,16 +78,20 @@ export const MenuBarMixin = (superClass) =>
7878
* ];
7979
* ```
8080
*
81-
* #### Disabled items
81+
* #### Disabled buttons
8282
*
83-
* When an item is disabled, it prevents any user interaction with it, such as
84-
* focusing, clicking, opening a sub-menu, etc. The item is also removed from
85-
* tab order, which makes it inaccessible to screen readers.
83+
* When a root-level item (menu bar button) is disabled, it prevents all user
84+
* interactions with it, such as focusing, clicking, opening a sub-menu, etc.
85+
* The button is also removed from tab order, which makes it unreachable via
86+
* the keyboard navigation.
8687
*
87-
* To improve accessibility, disabled root-level items (menu bar buttons) can be
88-
* made focusable so that screen readers can still reach and properly announce
89-
* them, while still preventing clicks. This is currently available as an
90-
* experimental enhancement that can be enabled with the following feature flag:
88+
* While the default behavior effectively prevents accidental interactions,
89+
* it has an accessibility drawback: screen readers skip disabled buttons
90+
* entirely, and users can't see tooltips that might explain why the button
91+
* is disabled. To address this, an experimental enhancement allows disabled
92+
* menu bar buttons to receive focus and show tooltips, while still preventing
93+
* other interactions. This feature can be enabled with the following feature
94+
* flag:
9195
*
9296
* ```
9397
* // Set before any menu bar is attached to the DOM.

0 commit comments

Comments
 (0)