From f96e2e3213a28b23bb03a8bea12c6570cb3fdfca Mon Sep 17 00:00:00 2001 From: Marin Atanasov <8436925+tyxla@users.noreply.github.com> Date: Thu, 28 Nov 2024 11:01:49 +0200 Subject: [PATCH] Edit Site: Fix block styles navigation error --- .../block-editor/src/components/iframe/use-scale-canvas.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/packages/block-editor/src/components/iframe/use-scale-canvas.js b/packages/block-editor/src/components/iframe/use-scale-canvas.js index c72266e82e2b0a..1c6cdb7e2da7a3 100644 --- a/packages/block-editor/src/components/iframe/use-scale-canvas.js +++ b/packages/block-editor/src/components/iframe/use-scale-canvas.js @@ -379,7 +379,9 @@ export function useScaleCanvas( { * If we already have an animation running, reverse it. */ if ( animationRef.current ) { - animationRef.current.reverse(); + if ( animationRef.current.timeline.currentTime ) { + animationRef.current.reverse(); + } // Swap the transition to/from refs so that we set the correct values when // finishZoomOutAnimation runs. const tempTransitionFrom = transitionFromRef.current;