Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Feature Request] Combobox #499

Closed
alessiogmonti opened this issue May 16, 2024 · 2 comments
Closed

[Feature Request] Combobox #499

alessiogmonti opened this issue May 16, 2024 · 2 comments

Comments

@alessiogmonti
Copy link

Hello,
When adding a search component to the Select component, something like:

<Select.Root defaultValue="apple">
  <Select.Trigger />
  <Select.Content>
    <Select.Group>

      <TextField.Root
          placeholder="Search..."
          value={search}
          onChange={handleSearchInput}>
          <TextField.Slot>
            <MagnifyingGlassIcon height="16" width="16" />
          </TextField.Slot>
        </TextField.Root>

    </Select.Group>
    <Select.Separator />
    <Select.Group>
      <Select.Label>Vegetables</Select.Label>
      <Select.Item value="carrot">Carrot</Select.Item>
      <Select.Item value="potato">Potato</Select.Item>
    </Select.Group>
  </Select.Content>
</Select.Root>

Typing in the text field causes focus to jump to the list items. It would be nice to be able to disable focus to prevent this from happening.

My understanding is that the preferred way to do this is rebuilding the Search/Select inside Popover, which is what I'm doing, so I've made this a feature request instead of an issue.

I think it would be worth adding this because there are some additional conveniences in the Select component for rendering and selecting list items that are missing inside Popover.

@vladmoroz vladmoroz changed the title [Feature Request] Making it possible to add a Search component to Select [Feature Request] Combobox May 22, 2024
@vladmoroz
Copy link
Contributor

You are essentially asking for a combobox, which is much more complex than composing a select with a text field. This is something we are tracking on the Primitives side and out of scope for Radix Themes right now

@vladmoroz vladmoroz closed this as not planned Won't fix, can't repro, duplicate, stale May 22, 2024
@vladmoroz
Copy link
Contributor

In the meantime I'd suggest to use an unstyled component library that provides a combobox primitive and style it with Radix Themes CSS variables

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

No branches or pull requests

2 participants