From 4194208590ae3f39f4e60b4d0f62cc9abd7a9956 Mon Sep 17 00:00:00 2001 From: Nikki Massaro Date: Tue, 6 May 2025 18:22:18 -0400 Subject: [PATCH 1/4] docs(picker): updated docs with allowed menu content --- packages/picker/README.md | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) diff --git a/packages/picker/README.md b/packages/picker/README.md index d0ebf27c96e..2d331c0d383 100644 --- a/packages/picker/README.md +++ b/packages/picker/README.md @@ -32,6 +32,8 @@ import { Picker } from '@spectrum-web-components/picker'; ### Anatomy +A picker includes a label and a menu.. + #### Labels To render accessibly, an `` element should be paired with an `` element that has the `for` attribute referencing the `id` of the `` element. @@ -91,6 +93,32 @@ For an accessible label that renders within the bounds of the picker itself, but +#### Menu + +The picker menu is a menu element that is used to display the options for the picker. A picker menu can include menu items, menu dividers, and menu groups. A picker menu should never contain submenus, as doing so would render it in accessible. + +If you require a submenu, use and [action menu](./action-menu) instead. + +```html demo + + Select a free food item: + + Fruits + Apple + Banana + Pear + + + + Vegetables + Artichoke + Carrot + Potato + + + +``` + #### Icons ``s in an `` that are provided content addressed to their `icon` slot will be passed to the `` element when that item is chosen. @@ -660,3 +688,7 @@ Use [``](../help-text/) to add help text and error text: + +#### Do not use submenus + +A picker menu should never contain submenus, as doing so would render it in accessible. A picker's menu role is a listbox and it's menu items are listbox options, which are not allowed to have submenus. From 42cbf31eb5baa9d1d9536110d481877fb3817388 Mon Sep 17 00:00:00 2001 From: Nikki Massaro Date: Tue, 6 May 2025 18:31:20 -0400 Subject: [PATCH 2/4] docs(picker): fixed types --- packages/picker/README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/picker/README.md b/packages/picker/README.md index 2d331c0d383..5e3ba699c57 100644 --- a/packages/picker/README.md +++ b/packages/picker/README.md @@ -95,9 +95,9 @@ For an accessible label that renders within the bounds of the picker itself, but #### Menu -The picker menu is a menu element that is used to display the options for the picker. A picker menu can include menu items, menu dividers, and menu groups. A picker menu should never contain submenus, as doing so would render it in accessible. +The picker menu is a menu element that is used to display the options for the picker. A picker menu can include menu items, menu dividers, and menu groups. A picker menu should never contain submenus, as doing so would render it inaccessible. -If you require a submenu, use and [action menu](./action-menu) instead. +If you require a submenu, use and [action menu](./action-menu) instead of a picker. ```html demo From 261d866ae3183f31553ba113b6e9e4ef30cd5dc0 Mon Sep 17 00:00:00 2001 From: Nikki Massaro <5090492+nikkimk@users.noreply.github.com> Date: Tue, 6 May 2025 18:44:05 -0400 Subject: [PATCH 3/4] docs(picker): fixed typo Co-authored-by: Casey Eickhoff <48574582+caseyisonit@users.noreply.github.com> --- packages/picker/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/picker/README.md b/packages/picker/README.md index 5e3ba699c57..e2177ecb1cf 100644 --- a/packages/picker/README.md +++ b/packages/picker/README.md @@ -32,7 +32,7 @@ import { Picker } from '@spectrum-web-components/picker'; ### Anatomy -A picker includes a label and a menu.. +A picker includes a label and a menu. #### Labels From d9f81210a0a0eb9bc1c1fc5da111b8710b8f6ef5 Mon Sep 17 00:00:00 2001 From: Nikki Massaro <5090492+nikkimk@users.noreply.github.com> Date: Tue, 6 May 2025 18:44:35 -0400 Subject: [PATCH 4/4] docs(picker): fixed typos Co-authored-by: Casey Eickhoff <48574582+caseyisonit@users.noreply.github.com> --- packages/picker/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/picker/README.md b/packages/picker/README.md index e2177ecb1cf..e47eb2f61f9 100644 --- a/packages/picker/README.md +++ b/packages/picker/README.md @@ -691,4 +691,4 @@ Use [``](../help-text/) to add help text and error text: #### Do not use submenus -A picker menu should never contain submenus, as doing so would render it in accessible. A picker's menu role is a listbox and it's menu items are listbox options, which are not allowed to have submenus. +A picker menu should never contain submenus, as doing so would render it inaccessible. A picker's menu role is a listbox, and its menu items are listbox options, which are not allowed to have submenus.