Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions packages/react-native-reanimated/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
### 🐛 Bug fixes

- Fix `normalizeColor` resolving `Object.prototype` members such as `'constructor'` and `'toString'` as color names and returning a function instead of `null`. ([#10387](https://github.com/software-mansion/react-native-reanimated/pull/10387) by [@dennytosp](https://github.com/dennytosp))
- Fix `transform` and `transformOrigin` strings padded with whitespace throwing instead of parsing. ([#10388](https://github.com/software-mansion/react-native-reanimated/pull/10388) by [@dennytosp](https://github.com/dennytosp))
- Fix animated styles on sticky headers throwing an immutable-object mutation error in development. ([#10389](https://github.com/software-mansion/react-native-reanimated/pull/10389) by [@ngocdevv](https://github.com/ngocdevv))
- Fix shared element transitions never running on Android for npm installs by publishing `react-native.config.js`, which registers the Shared Transition Boundary component descriptor for autolinking. ([#10375](https://github.com/software-mansion/react-native-reanimated/pull/10375) by [@dennytosp](https://github.com/dennytosp))
- Keep exiting views at their position in the host tree, so they no longer draw above later siblings. ([#10392](https://github.com/software-mansion/react-native-reanimated/pull/10392) by [@pawicao](https://github.com/pawicao))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -287,6 +287,14 @@ describe(processTransform, () => {
{ rotate: '45deg' },
],
},
{
input: ' translate(25, 25) scale(2) ',
output: [{ translateX: 25 }, { translateY: 25 }, { scale: 2 }],
},
{
input: '\n translate(25, 25)\n scale(2)\n',
output: [{ translateX: 25 }, { translateY: 25 }, { scale: 2 }],
},
{
input: 'translate(50, 50) scale(1.5, 2) skew(30deg, 15deg)',
output: [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,20 @@ describe(processTransformOrigin, () => {
},
],
},
{
name: 'padded string syntax',
cases: [
{
name: 'surrounded by whitespace',
cases: [
{ input: ' 50% 50%', output: ['50%', '50%', 0] },
{ input: ' left top ', output: [0, 0, 0] },
{ input: '\n 25px 25% 25px\n', output: [25, '25%', 25] },
{ input: '\tcenter', output: ['50%', '50%', 0] },
],
},
],
},
{
name: 'array syntax',
cases: [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -184,6 +184,7 @@ export const processTransform: ValueProcessor<TransformsArray | string> = (
}

return value
.trim()
.split(/\)\s*/)
.filter(Boolean)
.flatMap((part) => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,8 @@ export const processTransformOrigin: ValueProcessor<
> = (value) => {
'worklet';
const isArray = Array.isArray(value);
let components = typeof value === 'string' ? value.split(/\s+/) : value;
let components =
typeof value === 'string' ? value.trim().split(/\s+/) : value;
const customParse = isArray ? () => null : parsePx;

if (components.length < 1 || components.length > 3) {
Expand Down
Loading