feat(core): selection controller#6402
Conversation
🦋 Changeset detectedLatest commit: 7ec56a7 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
📚 Branch Preview Links🔍 First Generation Visual Regression Test ResultsWhen a visual regression test fails (or has previously failed while working on this branch), its results can be found in the following URLs:
Deployed to Azure Blob Storage: If the changes are expected, update the |
…pectrum-web-components into nikkimk/poc-selection-controller
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
| <DocsFooter /> | ||
| ``` | ||
|
|
||
| #### Controller MDX template |
There was a problem hiding this comment.
Controllers require different documentation, like how to use them with a host, so they should have different rules.
| 10. **BEHAVIORS STORIES** - Built-in functionality (if applicable) | ||
| 11. **ACCESSIBILITY STORIES** - A11y demonstration | ||
|
|
||
| #### Controller section order |
There was a problem hiding this comment.
Controllers require different documentation, like how to use them with a host, so they should have different rules.
| const items = this.getEligibleItems(); | ||
| if (items.length === 0) { | ||
| for (const el of this.getRawItems()) { | ||
| // getRawItems() calls getItems() which may return [] when the host |
There was a problem hiding this comment.
Needed to make adjustments once the controller was implemented with a host that can be disabled.
| // Fall back to event.code when event.key is empty (synthetic test events). | ||
| // Real browser events always populate event.key, so this never affects | ||
| // numpad disambiguation (e.g. Numpad6 NumLock-off sets key='ArrowRight'). | ||
| const key = event.key || event.code; |
There was a problem hiding this comment.
When used with selection controller, there were issues with conflicts in keyboard events.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…ies (#6403) * feat(*): rename /shared to /_lit-styles * docs(css, ai): document process and features of shared style directories
* docs(color-handle): accessbility migration-analysis * docs(color-handle): added notes from adobe a11y * docs(color-loupe): added adaptive border guidance
…pectrum-web-components into nikkimk/poc-selection-controller
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…pectrum-web-components into nikkimk/poc-selection-controller
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…nikkimk/poc-selection-controller
Description
Motivation and context
This controller could handle selection for tabs, accordions, radio groups, swatch groups with selectable swatches, button groups that function as radio groups, menus, and pickers.
Related issue(s)
Screenshots (if appropriate)
Author's checklist
Reviewer's checklist
patch,minor, ormajorfeaturesManual review test cases
Selection Controller
Tabs
Is the creation and implementation of this controller useful for tabs, accordions, radio groups, swatch groups with selectable swatches, button groups that function as radio groups, menus, and pickers? Or is it easier just to let each custom element handle its own selection management?
Device review