Button doesn't do normal animation in this case....

I have a list of buttons that I use all the time and the code swaps out what is in the list. I have a button animation that changes the text from white to red on hover, to blue on pressed, and to white on normal.

If the alignment of the list (it’s variable length) is set such that when I click the button from list 1 and don’t move my cursor, the next list comes up hilighted which is fine. Or would be if, when I moved the cursor, it then played the normal animation and returned the text to white, but instead the text remains red until I click on something else. The other text hilights red just fine, but this one, the one that came up under the cursor so it instantiated in as red doesn’t change to white, it just remains red forever and ever.

I think this might be a bug. If not, other than tell my players “Move your cursor immediately after you click if it bothers you”, is there something I can do to fix it. I have tried a reset of all the buttons to set text.color to white, but to no avail. Whatever color the button is in the editor, text.color = Color.white doesn’t affect it in the least.

Hm, that is rather strange. You could try to catch the button events yourself, just to see, if there is a problem with throwing the events. To check the events I made a little script:

using UnityEngine;
using UnityEngine.UI;
using UnityEngine.EventSystems;
using System.Collections;

public class ButtonDebugLog : MonoBehaviour, IPointerDownHandler, IPointerUpHandler, IPointerExitHandler, IPointerEnterHandler {
    private Animator buttonAnimator;
    private bool pointerIsInside = false;
    private bool buttonDown = false;
   

    public void OnPointerDown (PointerEventData eventData) {
        Debug.Log("ButtonDown");
        pointerIsInside = true;
        buttonDown = true;
    }

    public void OnPointerUp (PointerEventData eventData) {
        if(pointerIsInside && buttonDown) {
            Debug.Log("ButtonUp");
            pointerIsInside = false;
        }
        buttonDown = false;
    }

    public void OnPointerExit (PointerEventData eventData) {
        if(buttonDown) {
            Debug.Log("ButtonExit");
        }
        pointerIsInside = false;
    }

    public void OnPointerEnter (PointerEventData eventData) {
        pointerIsInside = true;
    }
}

Try to see, if you get all debugs you are expecting.