inline border style not updated on some pointer events

For custom themes, I set the style of a VisualElement manually via callbacks on focus, blur, pointerEnter, pointerExit

Thereby, I found an issue with border color: it is not rendered properly sometimes, namely when changed as part of pointerExit.

In the GIF, you can see that the UIToolkit Debugger shows the border color correctly, but the VisualElement in the game view is still rendered with the previous border color. There is a clear mismatch of UIToolkit Debugger and Game View.

I think this is a bug. FYI

8873184--1211658--visualelement-border-bug.gif

The issue does not occur when there is a USS transition defined for border-color:

.unity-button {
    transition: border-color 0.2s;
}

Works for me.

Thanks for reporting this. It definitely looks like a bug.

When we know that the color will change, (when transition is set) we use a different mechanism to update the color, but there should be no visual difference between both.

Can you provide the call stack of when you modify the value during pointerExit along with the code snipped of the changes? I suspect we are missing a check along the path.