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

[bug]: Combobox should have similar focus to select and other inputs #4806

Open
2 tasks done
jkinley opened this issue Sep 10, 2024 · 0 comments
Open
2 tasks done

[bug]: Combobox should have similar focus to select and other inputs #4806

jkinley opened this issue Sep 10, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@jkinley
Copy link

jkinley commented Sep 10, 2024

Describe the bug

Currently when you focus on the combobox there is no focus ring. However, if you tab to the combobox (using focus-visible) there is a ring. The goal should be to make the combobox work like the select regarding focus rings.

The problem is that the trigger for the combobox is a button and buttons in shadcn don't have a ring on focus.

The Combobox example does not have the correct classes on the trigger (Button).

image

The Select component has focus classes on the trigger (Button):

image

When I add the tailwind focus classes to my combobox it seems to work ok, but not quite the experience as the Select.

<Popover open={open} onOpenChange={setOpen}>
        <PopoverTrigger asChild>
          <Button
            variant="outline"
            role="combobox"
            aria-expanded={open}
            className="w-[200px] justify-between ring-offset-background focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2"
          >
image

but maybe you want to have more integrated solution.

Affected component/components

Combobox

How to reproduce

  1. Click on combobox, is no focus ring.
  2. Tab to combobox, there is focus ring.
  3. Click on select, there is focus ring.
  4. Tab to select, there is focus ring.

Codesandbox/StackBlitz link

https://ui.shadcn.com/docs/components/combobox

Logs

No response

System Info

Chrome latest
Shadcn latest

Before submitting

  • I've made research efforts and searched the documentation
  • I've searched for existing issues
@jkinley jkinley added the bug Something isn't working label Sep 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant