Skip to content

fix(web): exact-match transform function names in style key regex#2515

Merged
joshuaellis merged 2 commits into
nextfrom
fix/issue-1912
May 22, 2026
Merged

fix(web): exact-match transform function names in style key regex#2515
joshuaellis merged 2 commits into
nextfrom
fix/issue-1912

Conversation

@joshuaellis
Copy link
Copy Markdown
Member

Closes #1912.

Summary

User-defined style keys like scale3dValue or translateY_v2 were hijacked by the ^(matrix|translate|scale|rotate|skew) prefix match in AnimatedStyle, then emitted as invalid CSS (e.g. scale3dValue(0.5)), which the browser silently drops — taking the rest of the composed transform with it.

The fix anchors the regex with $ and enumerates the exact CSS transform-function names from MDN:

/^(matrix3d|matrix|translate3d|translate[XYZ]?|scale3d|scale[XYZ]?|rotate3d|rotate[XYZ]?|skew[XY]?)$/

Any other key now passes through as a regular style prop.

@vercel
Copy link
Copy Markdown

vercel Bot commented May 22, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
react-spring Error Error May 22, 2026 2:56pm

Request Review

@changeset-bot
Copy link
Copy Markdown

changeset-bot Bot commented May 22, 2026

⚠️ No Changeset found

Latest commit: 28d7e4e

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@joshuaellis joshuaellis force-pushed the next branch 2 times, most recently from 622c16d to 9ef804a Compare May 22, 2026 13:30
User-defined style keys with prefixes like 'scale3dValue' or 'translateMe'
were hijacked by the prefix-based regex in AnimatedStyle, emitted as
invalid CSS, and silently dropped by the browser along with the composed
transform. Anchor the regex and enumerate the exact CSS transform-function
names from MDN so only documented functions are picked up.

Closes #1912
@joshuaellis joshuaellis merged commit c220465 into next May 22, 2026
21 of 22 checks passed
@joshuaellis joshuaellis deleted the fix/issue-1912 branch May 22, 2026 15:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[bug]: View interpolation doesn't work with some "to" variables in coming up with a final transform

1 participant