File tree Expand file tree Collapse file tree 1 file changed +12
-1
lines changed
addons/block_code/ui/blocks/utilities/parameter_input Expand file tree Collapse file tree 1 file changed +12
-1
lines changed Original file line number Diff line number Diff line change @@ -244,7 +244,18 @@ func _update_option_input(current_value: Variant = null):
244244 if item == current_value :
245245 selected_item_index = item_index
246246
247- if _option_input .item_count == 0 :
247+ if selected_item_index == - 1 and current_value :
248+ # If the current value is not in the default list of options, add it
249+ # and select it.
250+ if _option_input .item_count > 0 :
251+ _option_input .add_separator ()
252+ var item_index = _option_input .item_count
253+ var option_label = current_value .capitalize () if current_value is String else str (current_value )
254+ _option_input .add_item (option_label )
255+ _option_input .set_item_tooltip (item_index , current_value )
256+ _option_input .set_item_metadata (item_index , current_value )
257+ selected_item_index = item_index
258+ elif _option_input .item_count == 0 :
248259 var item_index = _option_input .item_count
249260 _option_input .add_item ("<%s >" % placeholder )
250261 _option_input .set_item_disabled (item_index , true )
You can’t perform that action at this time.
0 commit comments