Skip to content

feat(combobox): add autoHighlight prop#2079

Draft
maxffarrell wants to merge 1 commit into
huntabyte:mainfrom
maxffarrell:codex/combobox-auto-highlight
Draft

feat(combobox): add autoHighlight prop#2079
maxffarrell wants to merge 1 commit into
huntabyte:mainfrom
maxffarrell:codex/combobox-auto-highlight

Conversation

@maxffarrell

Copy link
Copy Markdown
Contributor

Summary

Adds an autoHighlight prop to Combobox.Root so the first matching item can be highlighted automatically after the user filters the list.

This follows the public Base UI combobox surface that shadcn/ui consumes: autoHighlight?: boolean. Base UI internally has a stronger 'always' mode, but its public Combobox.Root prop exposed to shadcn/ui is boolean, where true highlights after input/filtering rather than on initial open.

Changes

  • Adds autoHighlight?: boolean to combobox root props.
  • Wires the prop through the shared select/combobox state.
  • Suppresses the initial-open highlight when autoHighlight is enabled for comboboxes.
  • Highlights the first available candidate after combobox input changes settle.
  • Documents the prop in the combobox API docs and highlighted-items section.
  • Adds browser coverage for matching and empty-filter behavior.

Validation

  • pnpm -F bits-ui build
  • pnpm -F bits-ui check
  • pnpm exec prettier --check .changeset/quiet-comboboxes-highlight.md docs/content/components/combobox.md docs/src/lib/content/api-reference/combobox.api.ts packages/bits-ui/src/lib/bits/combobox/components/combobox.svelte packages/bits-ui/src/lib/bits/combobox/types.ts packages/bits-ui/src/lib/bits/select/components/select.svelte packages/bits-ui/src/lib/bits/select/select.svelte.ts tests/src/tests/combobox/combobox.browser.test.ts

Note: focused pnpm -F tests test:browser --browser chromium src/tests/combobox/combobox.browser.test.ts started successfully after building the package, but this local Node 26/Vitest browser setup OOMed before completion, including when narrowed to -t auto-highlight.

@changeset-bot

changeset-bot Bot commented Jun 22, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 7594ff9

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
bits-ui Patch

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

@github-actions

github-actions Bot commented Jun 22, 2026

Copy link
Copy Markdown
Contributor
built with Refined Cloudflare Pages Action

⚡ Cloudflare Pages Deployment

Name Status Preview Last Commit
bits-ui ✅ Ready (View Log) Visit Preview 7594ff9

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant