Dropdown components (menu, select, combobox, autocomplete)#85
Conversation
commit: |
675abe2 to
c22722a
Compare
c797986 to
1571f10
Compare
67105b5 to
c85f035
Compare
- Narrow Select renderValue type based on multiple discriminant - Add value/defaultValue props to Autocomplete.Async - Export AsyncFetcher type from public API - Add JSDoc explaining Combobox.Creatable T extends object constraint
Use !== undefined instead of ?? so that value="" is correctly treated as controlled mode.
…rules - Add Pattern D (Standalone) for pre-assembled + Parts components - Clarify Pick<> rule: Root uses Pick<>, leaf sub-components use ComponentProps - Note Pattern D can combine with Pattern C (directory split)
|
/review |
Document that items are identified as groups by the presence of label and items fields. Consumers should avoid item types whose shape coincidentally matches this structure.
| } | ||
| ComboboxClear.displayName = "Combobox.Clear"; | ||
|
|
||
| function ComboboxChips({ className, ...props }: React.ComponentProps<typeof BaseCombobox.Chips>) { |
There was a problem hiding this comment.
Missing displayName on ComboboxChips. Every other sub-component in all new files has one?
There was a problem hiding this comment.
Added displayName to ComboboxChips, AutocompleteStandalone, and AutocompleteAsyncStandalone — the three components that were missing it.
Commit: 8509cd5
| * Internally filters out `item-press` events so that selecting an item does | ||
| * not trigger a redundant refetch. |
There was a problem hiding this comment.
My review agent thinks this JSDoc comment might be out of sync with the implementation. I don't see any obvious filtering happening?
There was a problem hiding this comment.
Good catch — the JSDoc claimed onValueChange "filters out item-press events" but that logic doesn't exist in the Autocomplete useAsync (it was likely copied from the Combobox variant). Simplified the JSDoc to remove the incorrect claim.
Commit: 375c078
… AutocompleteAsyncStandalone
Remove incorrect claim about filtering item-press events, which does not happen in the Autocomplete useAsync implementation.
Add new dropdown components (Menu, Select, Combobox, Autocomplete) and improve existing component APIs.
New Components
Select.Async.Combobox.Async.Autocomplete.Async.Select, Combobox, and Autocomplete each expose a
.Partsnamespace with low-level sub-components and hooks (useFilter,useAsync,useCreatable) for custom compositions.Other Changes
side/align/sideOffsetinto a singlepositionprop (old props preserved as deprecated for backward compatibility)positionprop