diff --git a/apps/automated/src/ui/animation/css-animation-tests.ts b/apps/automated/src/ui/animation/css-animation-tests.ts index d9d17d6376..49e5812578 100644 --- a/apps/automated/src/ui/animation/css-animation-tests.ts +++ b/apps/automated/src/ui/animation/css-animation-tests.ts @@ -212,7 +212,7 @@ export function test_ReadTranslateSingle() { TKUnit.assertEqual(translate.property, 'translate'); TKUnit.assertAreClose(translate.value.x, 30, DELTA); - TKUnit.assertAreClose(translate.value.y, 30, DELTA); + TKUnit.assertAreClose(translate.value.y, 0, DELTA); } export function test_ReadTranslateXY() { diff --git a/packages/core/ui/styling/style-properties.ts b/packages/core/ui/styling/style-properties.ts index 4ee4d25c9c..c0fb01e4ea 100644 --- a/packages/core/ui/styling/style-properties.ts +++ b/packages/core/ui/styling/style-properties.ts @@ -736,7 +736,13 @@ function normalizeTransformation({ property, value }: Transformation): Transform } function convertTransformValue(property: string, stringValue: string): TransformationValue { - const [x, y = x, z = y] = stringValue.split(',').map(parseFloat); + let [x, y, z] = stringValue.split(',').map(parseFloat); + if (property === 'translate') { + y ??= IDENTITY_TRANSFORMATION.translate.y; + } else { + y ??= x; + z ??= y; + } if (property === 'rotate' || property === 'rotateX' || property === 'rotateY') { return stringValue.slice(-3) === 'rad' ? radiansToDegrees(x) : x;