Skip to content

Combobox: After leaving with "tab" key and switching the selected option outside of the Combobox, the displayed value is not updated #3537

@omarkohl

Description

@omarkohl

What package within Headless UI are you using?

@headlessui/react

What version of that package are you using?

2.1.10

What browser are you using?

  • Firefox 131.0.3
  • Chromium 129.0.6668.100

Reproduction URL

https://github.com/omarkohl/combobox-bug

https://codesandbox.io/p/github/omarkohl/combobox-bug/main?import=true

Describe your issue

  1. Click in the Combobox input field
  2. Select a person e.g. Arlene Mccoy using the mouse or the keyboard
  3. Use the Tab key to exit the Combobox
  4. Click on the button "Select Tanya".
  5. Observed: Tanya Fox is now the selected person but the Combobox still displays "Arlene
    Mccoy".
  6. Expected: The Combobox should display "Tanya Fox" instead.

screenshot

The issue does NOT appear if in step 3 you use the mouse to exit the Combobox e.g. by clicking somewhere else or clicking directly on the "Select Tanya" button.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions