Skip to content

Commit

Permalink
Block Editor: Add a small fly-in animation when blocks first render o…
Browse files Browse the repository at this point in the history
…r zoom is changed.
  • Loading branch information
epiqueras committed Jul 12, 2019
1 parent 82df94d commit 5b4aa69
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,8 @@ function useMovingAnimation( ref, isSelected, enableAnimation, triggerAnimationO
ref.current.style.transform = 'none';
const destination = ref.current.getBoundingClientRect();
const newTransform = {
x: previous ? previous.left - destination.left : 0,
y: previous ? previous.top - destination.top : 0,
x: previous ? previous.left - destination.left : -50,
y: previous ? previous.top - destination.top : -50,
};
ref.current.style.transform = newTransform.x === 0 && newTransform.y === 0 ?
undefined :
Expand Down

0 comments on commit 5b4aa69

Please sign in to comment.