From 19743bbe4ae8ecc11bf3a7879f41c15085c4a922 Mon Sep 17 00:00:00 2001 From: Sam Reid Date: Fri, 18 Feb 2022 17:38:43 -0700 Subject: [PATCH] Don't animate the carousel while setting phet-io state, see https://github.com/phetsims/circuit-construction-kit-common/issues/841 --- js/Carousel.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/js/Carousel.js b/js/Carousel.js index c3c09a13..b70be401 100644 --- a/js/Carousel.js +++ b/js/Carousel.js @@ -284,7 +284,9 @@ class Carousel extends Node { // stop any animation that's in progress scrollAnimation && scrollAnimation.stop(); - if ( this._animationEnabled ) { + // Only animate if animation is enabled and PhET-iO state is not being set. When PhET-iO state is being set (as + // in loading a customized state), the carousel should immediately reflect the desired page + if ( this._animationEnabled && !phet.joist.sim.isSettingPhetioStateProperty.value ) { // options that are independent of orientation let animationOptions = {