Skip to content

.focus() nor .click() triggers popup open when autoHighlight is true #3825

@kylemh

Description

@kylemh

Bug report

Current behavior

If autoHighlight is true and a user clicks on the input in a combobox, the popup for the listbox will open (and the first item will be highlighted); however, .click() nor .focus() events on the input leads to the popup opening.

Expected behavior

The popup should open on input.click() when autoHighlight is true.

Reproducible example

https://stackblitz.com/edit/a3zpgezr?file=src%2FApp.tsx

Base UI version

Latest

Which browser are you using?

Chrome

Which OS are you using?

Mac OS

Additional context

On the surface, my point sounds pretty minor, but I think my usecase is one people will frequently face: adding a prefixed icon to the input area of the combobox. With multi-select combobox, it's not possible to put the Chips UI inside of a label because click events behave wildly (naturally). Since Chips cant go inside the label, the actual input and label are the only elements that open the popup when clicked if autoHighlight is true. This sucks because the input can get progressively smaller and is a moving target for seeing-eye users. I found myself and others clicking on the area where the prefixed icon is a safe, static place where I'd feel like the input could be targeted. So, I added a click handler to "click" the input if the area where the prefixed icon is clicked. This focuses the input, but it doesn't open the popup.

I don't actually believe I have any recourse besides changing Base UI source code because of the inability to switch between controlled and uncontrolled (not complaining about that bit though!)

Metadata

Metadata

Assignees

No one assigned

    Labels

    component: comboboxChanges related to the combobox component.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions