Skip to content

Commit

Permalink
Fix undefined ref when attempting to move group blocks (#23084)
Browse files Browse the repository at this point in the history
  • Loading branch information
talldan authored Jun 11, 2020
1 parent 2e9db83 commit 7887eb3
Showing 1 changed file with 9 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -135,11 +135,15 @@ function useMovingAnimation(
scrollContainer.current.scrollTop = transform.scrollTop + y;
}

ref.current.style.transformOrigin = 'center';
ref.current.style.transform =
x === 0 && y === 0 ? null : `translate3d(${ x }px,${ y }px,0)`;
ref.current.style.zIndex =
! isSelected || ( x === 0 && y === 0 ) ? null : '1';
if ( ref.current ) {
ref.current.style.transformOrigin = 'center';
ref.current.style.transform =
x === 0 && y === 0
? null
: `translate3d(${ x }px,${ y }px,0)`;
ref.current.style.zIndex =
! isSelected || ( x === 0 && y === 0 ) ? null : '1';
}
},
} );
}
Expand Down

0 comments on commit 7887eb3

Please sign in to comment.