Skip to content

Preserve negative values in transformOrigin strings#57691

Open
fallintoplace wants to merge 1 commit into
react:mainfrom
fallintoplace:fix-transform-origin-negative-values
Open

Preserve negative values in transformOrigin strings#57691
fallintoplace wants to merge 1 commit into
react:mainfrom
fallintoplace:fix-transform-origin-negative-values

Conversation

@fallintoplace

@fallintoplace fallintoplace commented Jul 25, 2026

Copy link
Copy Markdown
Contributor

Summary:

The numeric tokenizer updated in #57487 still starts at the first digit when a percentage or pixel value is negative. This silently changes values such as -12.5px -7.5px into [12.5, 7.5, 0].

Allow a leading minus in numeric tokens so negative percentages, pixel offsets, and leading-dot decimals retain their sign. The pattern is intentionally limited to the failing negative case and leaves leading-plus values unchanged.

Changelog:

[GENERAL] [FIXED] - Preserve negative values in transformOrigin strings.

Test Plan:

  • Added Fantom regression coverage for negative percentages, x/y/z pixel offsets, and leading-dot decimals in processTransformOrigin-itest.js
  • ./node_modules/.bin/prettier --check packages/react-native/Libraries/StyleSheet/processTransformOrigin.js packages/react-native/Libraries/StyleSheet/__tests__/processTransformOrigin-itest.js
  • ./node_modules/.bin/eslint --max-warnings 0 packages/react-native/Libraries/StyleSheet/processTransformOrigin.js packages/react-native/Libraries/StyleSheet/__tests__/processTransformOrigin-itest.js
  • Ran focused runtime checks against the Flow-stripped parser for the new negative cases and existing leading-plus behavior

@meta-cla meta-cla Bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Jul 25, 2026
@facebook-github-tools facebook-github-tools Bot added the Shared with Meta Applied via automation to indicate that an Issue or Pull Request has been shared with the team. label Jul 25, 2026
@fallintoplace
fallintoplace force-pushed the fix-transform-origin-negative-values branch from b957375 to d90d188 Compare July 25, 2026 20:24
@fallintoplace fallintoplace changed the title Fix negative values in transformOrigin string parser Preserve negative values in transformOrigin strings Jul 25, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. Shared with Meta Applied via automation to indicate that an Issue or Pull Request has been shared with the team.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant