-
Notifications
You must be signed in to change notification settings - Fork 235
Complete Menu selects implementation #1661
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
Branch Preview URLsWhen a visual regression test fails (or has previously failed while working on this branch), its results will be avaialable at the associated URL below:
|
Tachometer results for changed packagesaction-bar permalink
action-menu permalink
menu permalink
picker permalink
popover permalink
split-button permalink
tooltip permalink
|
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.
This is the most beautiful PR I've ever seen. Awesome job, and thanks for your hard work!
4140660 to
b46119c
Compare
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.
All the changes look great 💯
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.
|
Updates look great! |
|
Awesome PR! Thanks for the hard work here! |

Description
Allow
<sp-menu>elements to manage their own selection viaselects="single|multiple|inherit". By default, an<sp-menu>element will take no selection, as it has previously. Aselectsvalue ofsingleormultiplewill make this element a selection root and manage the selection of<sp-menu-item>children and descendants of[selects="inherit"]children. When a Menu element hasselects="inherit", it's<sp-menu-item>descendants will participate in the selection of the nearest ancestor withselects="single|multiple". Each Menu root that manages a selection will dispatchchangeevents outlining updates to its value. In this way, multiple selection roots inside of a non-selecting<sp-menu>parent can manage these changes via event delegation, as seen here.Single - Demo
spectrum-web-components/packages/menu/stories/menu.stories.ts
Lines 56 to 64 in a1a2ab3
Multiple - Demo
spectrum-web-components/packages/menu/stories/menu.stories.ts
Lines 82 to 90 in a1a2ab3
Inherit - Demo
spectrum-web-components/packages/menu/stories/menu-group.stories.ts
Lines 130 to 149 in a1a2ab3
Complex - Demo
spectrum-web-components/packages/menu/stories/menu-group.stories.ts
Lines 85 to 112 in a1a2ab3
<sp-menu>now manages selection inside of<sp-picker>elementsselectsattribute on<sp-action-menu>so that it can choose whether to take a selection of not. THIS IS A BREAKING CHANGE!<sp-picker>will validateselectstosinglewhen set for all derivative elements, preventing the application ofmultiple. This should be added in follow up work.<sp-menu-group>is now an extension of<sp-menu>simplifying the code there<sp-menu-group>to ensure availability in the accessibility tree.<sp-split-button>no longer takes a selection intype="more", correcting the visual delivery therenew Event()s in each Menu ItemEventrather thanCustomEventsRelated Issue
fixes #350
fixes #715
fixes #1189
fixes #1505
Motivation and Context
Menus need the ability to do much more than look pretty, and as the basis of a number of other UIs in the ecosystem they can reduce code duplication my having a central selection management implementation.
How Has This Been Tested?
Types of changes
Checklist: