[library] Reset layout state when layoutChildren() finishes