From 6e8d554607922202e5631e08fba478dc76a69a6b Mon Sep 17 00:00:00 2001 From: Sam Reid Date: Sat, 6 May 2023 08:23:43 -0600 Subject: [PATCH] Clear card cells on inactive, see https://github.com/phetsims/center-and-variability/issues/172 --- js/median/view/CardNodeContainer.ts | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/js/median/view/CardNodeContainer.ts b/js/median/view/CardNodeContainer.ts index 8e82d3d0..f6a22ae3 100644 --- a/js/median/view/CardNodeContainer.ts +++ b/js/median/view/CardNodeContainer.ts @@ -205,6 +205,11 @@ export default class CardNodeContainer extends Node { this.cardNodeCellsChangedEmitter.emit(); } + else if ( !isActive ) { + const index = this.cardNodeCells.indexOf( cardNode ); + this.cardNodeCells.splice( index, 1 ); + this.cardNodeCellsChangedEmitter.emit(); + } } ); return cardNode;