Unity-UI-Extensions/com.unity.uiextensions

Feature Request: Accordion - Dynamic content before Start()/Awake()

jonathan-bryant opened this issue · 2 comments

Unity UI Extensions Feature Request - Dynamic content before Start()/Awake()

I was having issues with the Accordion component loading correctly, especially in build.
This was due to dynamic content being added before the first frame. Adding the below to AccordionElement.cs fixed it for me:

private IEnumerator Start()
{
	yield return null; // Wait for the first frame
	OnValueChanged(this.isOn);
}

It's worth noting that a side effect of this issue was the inability to open that element after the first frame without enabling another element.

That is a severe limitation for how the Unity UI system works sadly @jonathan-bryant , although I will add an action to look into being able to initialise the control with some input to possible enable this capability.