Skip to content

[Feat]: Combobox's menu should show selected item on initial load #6045

@pwong09

Description

@pwong09

Code of conduct

  • I agree to follow this project's code of conduct.

Impacted component(s)

combobox

Description of the requested feature

Currently, there is no simple way on the API to mark a slotted element as selected on initial load even when the textContent on the input and the textContent on the slotted element matches exactly. (I believe this is because the combobox makes its own copy of the options from slotted elements)

I think this would be nice UI/UX to add so that users can see right away that a combobox with pre-filled text already matches an existing option. For example, setting combobox.value should update both the combobox's input value as well as look for matching options in its menu.

Mockups or screenshots

On initial load, it should look like below:
Image

If the text input doesn't match any of the menu options, then keep existing UI/UX:
Image

Implementation notes or ideas

No response

Would you like to track this issue in Jira?

  • Yes, please tell me the ticket number!

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions