Skip to content

Commit 501f466

Browse files
committed
docs(context-menu): update "Basic" example
1 parent afb62a7 commit 501f466

2 files changed

Lines changed: 3 additions & 1 deletion

File tree

docs/src/pages/components/ContextMenu.svx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@ In the examples, right click anywhere within the iframe.
1212
## Basic
1313

1414
The context menu appears when right-clicking anywhere in the window. Use context menu option for menu items and context menu divider for visual separation.
15+
16+
The root element has `role="menu"`. Set `labelText` or `aria-label` on `ContextMenu` so assistive technologies get a meaningful name. This matters most for the default window-wide behavior (`target` unset), where there is no visible trigger to label the menu with `aria-labelledby`.
1517

1618
<FileSource src="/framed/ContextMenu/ContextMenu" />
1719

docs/src/pages/framed/ContextMenu/ContextMenu.svelte

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
import TrashCan from "carbon-icons-svelte/lib/TrashCan.svelte";
1010
</script>
1111

12-
<ContextMenu>
12+
<ContextMenu labelText="Menu actions">
1313
<ContextMenuOption labelText="Copy" shortcutText="⌘C" icon={CopyFile} />
1414
<ContextMenuOption labelText="Cut" shortcutText="⌘X" icon={Cut} />
1515
<ContextMenuDivider />

0 commit comments

Comments
 (0)