Branch: Binary, build 4.5.1
Description:
If you have a ComboBoxString control in your UMG widget, and attempt to dynamically update the options within it, it will only update up until the point the user selects an option from the combo box. Once an option has been selected all calls to ‘Clear Options’ and ‘Remove Option’ no longer function. ‘Add Options’ continues to work fine. In my particular use-case it’s causing my entire editor to crash, but my repro steps aren’t (but does show the broken behavior). The crash only happens after I open the combo box - so it doesn’t appear to be anything specific to my blueprint, just the order in which I’m calling the updates perhaps. As soon as I click the dropdown arrow I see the list of (old, unupdated) options and the editor fully crashes - so long as I don’t click the arrow it never crashes. The exception code is:
Unknown exception - code 00000001 (first/second chance not available)
Repro:
- Create a new UMG widget/menu, and add a ComboBoxString control to it.
- Populate the combo box in the editor with some temp strings (A, B, C, etc)
- Create a Button control, and bind a click event to it.
- In Blueprint, on the click event, call ‘Clear Options’ on the combo box, then ‘Add Option’ for a few different values (D, E, F, etc).
- Launch the game, and first click on the ComboBox arrow to open the dropdown - note the options but do not select one.
- Now click the button, and look at the combo box options again - they should have changed to the secondary values.
- Restart the game - this time, drop down the ComboBox options and actually select one.
- Now press the button and look again at the options. They will not have changed, and will still be the initial values - despite ‘Clear Options’ being called, and new ones added.
Expected:
When ‘Clear Options’ is called, at any time, the ComboBox should clear and any prior selections be reset. I thought I could potentially get around the problem by destroying the ComboBox control and creating a fresh new one - but that does not appear to be possible with Blueprint.
Other notes:
- ‘Get Selected Option’, ‘Get Option at Index’, and ‘Find Option Index’ - while shown in the API documentation, are not available in Blueprint (so there’s no way to poll the control and see what option is currently selected).