fix(studio): a GSAP scaleX or scaleY tween also keeps a resize on the GSAP route

They are GSAP's names for parts of the one CSS scale the box writer sets.
This commit is contained in:
Miguel Angel Simon Sierra
2026-10-01 00:02:13 -07:00
parent e07cc394dd
commit 5ae51f1d1b
2 changed files with 8 additions and 4 deletions
@@ -686,7 +686,7 @@ describe("a resize's anchor member", () => {
expect(member.element.style.getPropertyValue("translate")).toBe("-10.25px 3.5px");
});
it.each(["width", "maxWidth", "minHeight", "flexBasis", "scale"])(
it.each(["width", "maxWidth", "minHeight", "flexBasis", "scale", "scaleX"])(
"leaves a box whose %s GSAP tweens, which the CSS box writer also sets, to the GSAP writer",
(channel) => {
expect(anchorMember({ [channel]: 300 }).plainTranslate).toBe(false);
@@ -447,9 +447,13 @@ export function gsapWritesPosition(el: Element): boolean {
return !!cache?.renderTransform || gsapWritesChannels(el, MOVE_CHANNELS);
}
const BOX_CHANNELS = BOX_SIZE_STYLE_PROPS.map((prop) =>
prop.replace(/-([a-z])/g, (_, c: string) => c.toUpperCase()),
);
const BOX_CHANNELS = [
...BOX_SIZE_STYLE_PROPS.map((prop) =>
prop.replace(/-([a-z])/g, (_, c: string) => c.toUpperCase()),
),
"scaleX",
"scaleY",
];
/** GSAP owns this element's box: its position, or any property the CSS box writer sets. Else a resize writes CSS. */
export function gsapWritesBox(el: Element): boolean {