ui icon indicating copy to clipboard operation
ui copied to clipboard

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

Open arguiot opened this issue 1 month ago • 2 comments

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

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

arguiot avatar Dec 02 '25 17:12 arguiot

I can confirm the issue. The CommandInput does not autofocus when a Combobox is placed inside a Radix DropdownMenu. Expected: Input should focus so users can immediately start typing Actual: User needs to click the input manually

Tested on: macOS 15.5 (24F74) - Apple Silicon browser: Chrome

Thanks for the great library — would like to contribute to this issue

devel-maverick avatar Dec 02 '25 18:12 devel-maverick

So many issues like this would be resolved by simply migrating shadcn from Radix UI to Base UI...

andreastande avatar Dec 09 '25 02:12 andreastande