In the Items of ItemList, the Disabled attribute has no effect.

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By Zorth

In the Items of ItemList, the Disabled attribute has no effect. I printed the Disabled status of all Items. When it is true or false, it can be clicked to take effect. Is this a bug of godot4 or am I doing something wrong.

:bust_in_silhouette: Reply From: jgodfrey

Playing with this, it definitely feels like a bug to me. Looking at open issues, I see at least these related items…

So, yeah, definitely a bug I think.

As a workaround, you could manually check the disabled state of the activated item prior to acting on it. So, in the item_activated signal handler, something like:

func _on_item_activated(index):
	if !is_item_disabled(index):
		# handle activated item logic

Thank you very much

Zorth | 2023-06-29 17:12