Skip to content

Commit

Permalink
fix(transform): intialize each axis for translate
Browse files Browse the repository at this point in the history
  • Loading branch information
Tahul committed Feb 24, 2022
1 parent d4d82cb commit 1c0a0e4
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/utils/transform-parser.ts
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,13 @@ export function stateFromTransform(

// Handle translate3d and scale3d
if (key === 'translate3d') {
if (value === 0) {
axes.forEach((axis) => {
__set(state, axis, 0)
})
return
}

// Loop on parsed scale / translate definition
value.forEach((axisValue: ResolvedValueTarget, index: number) => {
__set(state, axes[index], axisValue)
Expand Down

0 comments on commit 1c0a0e4

Please sign in to comment.