Repository navigation
Render native Option rows in Select and PowerSelect - #762
Conversation
phndiaye
reviewed
Dec 3, 2026
|
|
||
| @action | ||
| toggleDropdown(event: MouseEvent): void { | ||
| if (this.args.disabled) return; |
Member
There was a problem hiding this comment.
In some PowerSelects, we have rules like:
- if more than 3 items, only display one chip saying " items selected" (for example ("4 countries selected")
in that case, we kinda rely on the dropdown to see what's currently selected.
If coupled with that new rule, it means users are blocked with only the <n> items selected without knowing what 😅
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What does this PR do?
Second step of aligning the Search dropdowns with the dropdown design system.
OSS::SelectandOSS::PowerSelectcan now renderOSS::InfiniteSelect::Optionrows directly, so consumers no longer build their own rows (checkbox, check icon, wiring).Stacked on #761: it targets its branch and should be merged after it.
:rownamed block. It yields the item, anOptioncomponent already wired, and the index:<:row as |item Option index|>. The consumer only passes display arguments (@title,@prefixCountry,@subtitle…).selectionType="single",selectedandonSelectgoing through the Select (onChange, then close).selectionType="multiple"andselected= "the item is in@selectedItems". A consumer can still pass its own@selected. The dropdown stays open after a selection.Optionrow titled with@targetLabel.@valueKeyto compare the current value with the items by key. Without it, the comparison stays by reference. It also applies to the check icon of the legacy:optionrows.@disabled: the dropdown cannot be opened and the field uses the existing disabled style.Optionis disabled.The legacy
:optionand:option-itemblocks render as before, so the existing usages are untouched and can be migrated later.How the rows are rendered
For each item, Select picks the first block it finds:
:row(new): Select yields the item, anOptioncomponent already wired, and the index. The consumer only passes display arguments, and its arguments win over the wired ones (e.g.@selected,@disabled). The wired ones areselectionType="single",selected(current value) andonSelect(onChange, then close).The component is curried by name,
(component "o-s-s/infinite-select/option" …), because Embroider rejects(component this.x)as an unsafe dynamic component.:option(legacy): unchangeditem-wrapper+ check icon. Only the check now goes throughisSelected, so@valueKeyworks here too.No block: Select renders
<OSS::InfiniteSelect::Option @title={{concat (get item targetLabel)}} />.concatturns a non-string label (number, missing key) into text, sinceOptionrequires a string title.isSelected: no current value → no row checked; without@valueKey→ by reference, as before; with@valueKey→ by key, and no row is checked when the current value has no such key.PowerSelect uses the same
:rowblock withselectionType="multiple"(checkbox, no check icon). A row is selected when its item is in@selectedItems(the consumer can pass@selectedinstead), and the dropdown stays open after a selection. There is no default rendering::option-itemor:rowis required.Related to: https://linear.app/upfluence/issue/VEL-8818/oss-components-native-option-rows-in-select-and-powerselect
What are the observable changes?
In Storybook:
OSS::Select→With Row Named Block,Without Option BlockandWith Value Key(the current value is a copy of the item and is still checked).OSS::PowerSelect→With Row Named Block(checkbox rows, no extra check icon, selected rows inprimary-50/primary-500) andDisabled.:option/:option-itemlook as before.No visible change in the apps until the consumers move to
:row(Search selects in VEL-8819).Good PR checklist