UI navigation.mode not changing

I need to change the navigation mode on a group of buttons at runtime.

I currently have a coroutine with a loop inside to change a group.

   IEnumerator ButtonInitialize()
    {
        yield return new WaitForEndOfFrame();
        foreach (Transform button in buttonList.transform)
        {
            //if(button.name.Contains("buildButton"))
            if (button.CompareTag("NavButton"))
            {
                Debug.Log(button.name);
                bNavigation = button.GetComponent<Button>().navigation;
                bNavigation.mode = Navigation.Mode.None;
            }
        }
    }

Unfortunately the navigation mode isn’t being changed.

How could I rectify this?

This isn’t cleaned up properly but it will work.

public Button[] buttonList;

void Start(){
	ChangeMode ();
}

public void ChangeMode(){
	for (int i = 0; i < buttonList.Length; i++) {
		Navigation n = new Navigation ();
		n.mode = Navigation.Mode.None;
		buttonList *.navigation = n;*
  •   }*
    
  • }*