Skip to content

Commit

Permalink
useMovingAnimation: Clear translate3d rule when animation is finished (
Browse files Browse the repository at this point in the history
…#56410)

* useMovingAnimation: Clear translate3d rule when animation is finished

* Add inline comment for clarity
  • Loading branch information
andrewserong authored Nov 22, 2023
1 parent c283c44 commit ae57cac
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ function useMovingAnimation( {
const finishedMoving = x === 0 && y === 0;
ref.current.style.transformOrigin = 'center center';
ref.current.style.transform = finishedMoving
? undefined
? null // Set to `null` to explicitly remove the transform.
: `translate3d(${ x }px,${ y }px,0)`;
ref.current.style.zIndex = isSelected ? '1' : '';

Expand Down

0 comments on commit ae57cac

Please sign in to comment.