Skip to content

[ComboBox]: selected item may be wrong when there are multiple items with the same text #11239

@AlexYanSap

Description

@AlexYanSap

Bug Description

When the ComboBox has a pre-selected value, the item with the value will be selected. However, when there are multiple items with the same value, only the first of them will be selected.

In our case, the items are rendered by the modified date and when the second item with the same date is pre-selected, the comboBox will still show that the first item is selected which is not correct.

Affected Component

ComboBox

Expected Behaviour

act like Select component, support pre-select an item using the unique id instead of text

Isolated Example

No response

Steps to Reproduce

  1. go to the demo page.
  2. replace the html with
  <ui5-combobox value="Germany">
        <ui5-cb-item text="Austria"></ui5-cb-item>
        <ui5-cb-item text="Bulgaria"></ui5-cb-item>
        <ui5-cb-item text="Germany"></ui5-cb-item>
        <ui5-cb-item text="Germany"></ui5-cb-item>
        <ui5-cb-item text="Italy"></ui5-cb-item>
        <ui5-cb-item text="Spain"></ui5-cb-item>
    </ui5-combobox>

  1. then you will see the first Germany is selected even though I want the second to be selected.

Log Output, Stack Trace or Screenshots

No response

Priority

None

UI5 Web Components Version

2.8.0

Browser

Chrome

Operating System

No response

Additional Context

No response

Organization

SAP SF

Declaration

  • I’m not disclosing any internal or sensitive information.

Metadata

Metadata

Assignees

Type

Projects

Status

Completed

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions