Layout group of auto expand textbox

I have a horizontal layout group containing bunch of tags and each tag’s width is auto expanded by its text length.

The problem occurs when I change the text of tags during the page is inactive, the layout group seems doesn’t know the change of the tag’s width, so it collapse with other tags when it shows up.

I need to reactivate the layout group (uncheck and check again the checkbox in inspector), then the tags are reorganized to what they are supposed to be.

How can I change the text during inactive and the layout group can organize its elements correctly?

Using LayoutRebuilder.ForceRebuildLayoutImmediate to rebuild the layout group at OnEnable solves this issue.

void OnEnable () {
		StartCoroutine ("RebuildCoroutine");
	}

	IEnumerator RebuildCoroutine () {
		yield return new WaitForEndOfFrame ();
		LayoutRebuilder.ForceRebuildLayoutImmediate (GetComponent<RectTransform> ());
	}