-
Notifications
You must be signed in to change notification settings - Fork 221
docs(picker): updated docs with allowed menu content #5446
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
If you require a submenu, use and [action menu](./action-menu) instead. | ||
|
||
```html demo | ||
<sp-picker> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Example with menu groups since picker can accept them.
Branch previewReview the following VRT differencesWhen a visual regression test fails (or has previously failed while working on this branch), its results can be found in the following URLs:
If the changes are expected, update the |
@@ -91,6 +93,32 @@ For an accessible label that renders within the bounds of the picker itself, but | |||
</sp-tab-panel> | |||
</sp-tabs> | |||
|
|||
#### 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 inaccessible. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Notes that submenus would make a picker inaccessible.
packages/picker/README.md
Outdated
|
||
#### 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. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A more detailed explanation and reminder not to use submenus in a picker.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reinforcement 🤌 TY
Tachometer resultsCurrently, no packages are changed by this PR... |
packages/picker/README.md
Outdated
|
||
#### 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. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should this be inaccessible
? ✨
|
||
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 of a picker. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🎶 I loveeeeee this so much
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Lets Get This Merged
Co-authored-by: Casey Eickhoff <[email protected]>
Co-authored-by: Casey Eickhoff <[email protected]>
Oooh your LGTM game is strong, @caseyisonit! |
Description
sp-menu-group
Motivation and context
While answering Slack support questions about
sp-picker
, I noticed we do not have examples ofsp-picker
with grouped menu items usingsp-menu-group
. This is a valid use case, so we should show it in the docs.Additionally, I had a number of questions about using submenus and other interactive items in a
sp-picker
. This is not accessible, and we should note that in the accessibility section of the docs.Related issue(s)
Screenshots (if appropriate)
Author's checklist
Reviewer's checklist
patch
,minor
, ormajor
features (N/A docs update only)Manual review test cases
Picker Docs
sp-menu-group
elements in its menu?Device review