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.CompareTag("NavButton"))
                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;*
  •   }*
  • }*