question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

ui5-combobox: Add selectedComboBoxItem property/attribute

See original GitHub issue

Is your feature request related to a problem? Please describe. Currently it’s inconvenient to get the selected ui5-cb-item, because there is no selectedComboBoxItem prop/attribute as it is in e.g. the ui5-select component.

Describe the solution you’d like I would like to have a property that receives the selected item, which then can be accessed using the change event.

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:10 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
chisholmdcommented, May 10, 2020

“The idea of the combobox is that you will get a free text to type and a few suggestions which might fit, but in the end the text is important”

In my experience the answer to that question is no, it is not the text that is important. Way more often then not the combo box is used to display a look up list of some kind where you present the names to the user but the application needs the ID’s of their selection. Eg <select id="cityselector" name="city"> <item value=1>New York</option> <item value=2>Brazil</option> </select>

The user is going to pick a city name, but the app needs the id to perform the next operation such as update the database, or to fetch all hospitals where cityId=2 etc.

Isn’t this the most common pattern for others? I agree with the original poster that this element is missing THE fundamental property. The combobox should either have a property called “selectedValue” which contains the values attribute of the selected item.

Or mayber better, a “selectedIndex” property which provides the index of the selected item.

or…both

These guys do a pretty good job, and they provide both. https://component.kitchen/elix/AutoCompleteComboBox

Should I start another thread to request the ability to set an item as selected. Maybe I am missing something but I set an item as selected=true and it had no effect on the control.

0reactions
ilhan007commented, Sep 14, 2022

Closing the issue as it seems not relevant any more - Lukas and Vladi discussed and agreed the topic.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Scripting API: PropertyAttribute
A custom attributes can be hooked up with a custom PropertyDrawer class to control how a script variable with that attribute is shown...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found