Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions .changeset/match-select-base-ui-behaviour.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
---
'@gpuix/react': patch
---

Match Select with Base UI when items have no explicit value, when keyboard
navigation changes the active item, and when items are removed from the list.
Preserve group and label accessibility semantics and report the correct missing
ItemText context.
17 changes: 15 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3666,8 +3666,19 @@ so item content can reflect its current state. `Select.ItemText` accepts the
same function child; it renders with the current item state while the label
used by the trigger and typeahead comes from the unhighlighted, unselected
call. Item `label` and `textValue` props override that function-derived label.
Arrow Up/Down, Home/End and typeahead keep the highlighted item in view. Pointer
hover updates the highlight without changing the popup's scroll position.
`Select.Root`'s `itemToStringLabel` resolves object values for the closed
trigger; without it, values with `label` or `value` fields use those fields.
`Select.Popup` supplies the listbox role when no `Select.List` is rendered;
with a `List`, the role belongs to the list and the trigger does not set
`aria-controls`.
Opening the popup focuses the selected item, and closing it returns focus to
the trigger.
Arrow Up/Down, Home/End and typeahead move focus with the highlighted item and
keep it in view. Arrow Down on a closed trigger opens the popup; the next arrow
press moves through the items. Pointer hover updates the highlight without
changing the popup's scroll position. If a selected item is removed from the
list, a single Select returns to its initial value when that item remains;
multiple Select removes values whose items are no longer present.

### Build a local Select

Expand Down Expand Up @@ -3793,6 +3804,8 @@ the trigger. Disabled items are skipped. The highlighted item scrolls into
view, and scroll arrows appear only while the list can scroll further in that
direction. Home/End and PageUp/PageDown are not handled.

`onOpenChangeComplete` runs after the requested open state has rendered.

Select parts accept `className` and `style` functions with state matching the
corresponding Base UI part. `Root` renders no element and takes neither prop.
When a part accepts `render={<element />}`, the element's `className` is kept
Expand Down
Loading
Loading