Skip to content

[bug]: Combobox input doesn't autofocus inside a dropdown menu #8942

@arguiot

Description

@arguiot

Describe the bug

When rendering a Combobox inside a DropdownMenu, the Combobox's CommandInput doesn't receive focus automatically. I believe this is due to Radix's focus trapping behavior in DropdownMenu conflicting with Combobox's expected autofocus.

Affected component/components

Combobox, Dropdown menu

How to reproduce

Verify here in the Dropdown menu section, just hover over "Apply label": https://ui.shadcn.com/docs/components/combobox#dropdown-menu

Codesandbox/StackBlitz link

https://ui.shadcn.com/docs/components/combobox#dropdown-menu

Logs

System Info

OS: macOS Tahoe
Browser: Google Chrome

Before submitting

  • I've made research efforts and searched the documentation
  • I've searched for existing issues

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions