ComboBox Selected option bug?

  • Branch: Binary
  • Build version: 4.8.3 - 2634408

Issue: The widget ComboBox is not showing the selected option by default neither in-game nor in the editor (it always appears empty until I change it in-game)

Repro steps:

  1. Add ComboBox.
  2. Add a few elements to ‘Default Options’
  3. Set ‘Selected Option’

It works as intended. It’s “String” ComboBox so it’s expecting a string as input and gives a string at output. You can use foreach enumeration to populate it and then Find Option Index to get enum index.

55276-cb.png

I don’t have a problem getting the values out of it; the problem is that Set Selected Option is not working (at least on my end).

In this little test I added the options “Hello” & “World” (they indeed get added to the drop down menu) to the combobox.Then, when I click the Button_141 it should print my selected option. Unless I click and select an option from the drop down menu, nothing gets printed; Set Selected Option is not changing the selected option neither in the editor (the arrow in my first image) nor the function (attached image).

And I don’t really get what you mean by “it’s expecting a string as input”, you can’t input anything to it while you’re in-game.

As I said Selected Option should be string (you just putting the number) and should be equal to one of the options (Hello or World in your case).

Oh… I get it now. Thank you very much!
I thought it was expecting an index and not the text itself.

If you want select with number/index then you can do it like that (of course after options were added).

Thank you very much, I appreciate it.

One more note if it will help someone: if you dynamically fill your options list for your combo box: after calling “Set Selected Index” or “Set Selected String”, I had to call “Refresh Options” in order for the selected option to be displayed properly. This worked even when I didn’t have any values in the combo box’s default option field.