Thank you for looking into this!
I personally never would have figured out that the animation API or setting the position using transform.position was setting inline styles.
For anyone reading this, the solution is to simply set the translate style to null:
element.style.translate = new StyleTranslate(StyleKeyword.Null);
However, the issue where the button appears for one frame then disappears still happens. Should I report this as another bug?
On IEnumerator Start() at the end of the frame, I have the code to hide the button. (The entire menu has opacity to 0 so nothing should be visible).
settingsMenuToButton.transform.position = new Vector2(0, -(settingsMenuToButton.resolvedStyle.height + halfGamepadIconWidth));
Then I set the entire menu to opacity of 1.
shopLevelCollectableUIDocument.rootVisualElement.style.opacity = 1;
However, the only button that shows for a frame is the settings button.
If I remove this from the uss file, this doesn’t happen
.button-hover-slide-down-animation {
transition-duration: var(--button-hover-animation-duration);
transition-property: translate;
transition-timing-function: var(--button-hover-animation-timing);
}
What is weird is that even removing the :hover and :active styles of the uss BUT keeping the above code active, the “bug” still happens.
.button-hover-slide-down-animation:hover:enabled {
translate: 0 var(--button-hover-slide-distance-positive);
}
.button-hover-slide-down-animation:active:enabled {
translate: 0 var(--button-hover-slide-distance-positive);
}
It seems like the transition-property: translate; is somehow resetting the element back to 0 position for a frame?
Thanks!