-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Problems on Reset #172
Comments
Something like this may help with that unresetted card: Subject: [PATCH] Clear card cells on inactive, see https://github.com/phetsims/center-and-variability/issues/172
---
Index: js/median/view/CardNodeContainer.ts
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/js/median/view/CardNodeContainer.ts b/js/median/view/CardNodeContainer.ts
--- a/js/median/view/CardNodeContainer.ts (revision 6e8d554607922202e5631e08fba478dc76a69a6b)
+++ b/js/median/view/CardNodeContainer.ts (date 1683383199141)
@@ -207,8 +207,22 @@
}
else if ( !isActive ) {
const index = this.cardNodeCells.indexOf( cardNode );
- this.cardNodeCells.splice( index, 1 );
- this.cardNodeCellsChangedEmitter.emit();
+
+ if ( index >= 0 ) {
+ this.cardNodeCells.splice( index, 1 );
+ this.cardNodeCellsChangedEmitter.emit();
+ }
+ }
+ } );
+
+ cardModel.soccerBall.valueProperty.link( value => {
+ if ( value === null ) {
+ const index = this.cardNodeCells.indexOf( cardNode );
+
+ if ( index >= 0 ) {
+ this.cardNodeCells.splice( index, 1 );
+ this.cardNodeCellsChangedEmitter.emit();
+ }
}
} );
|
Fixed in the commit, with one TODO for discussion. |
Can't test this until #189 is fixed. So perhaps I'll increase its priority. |
Reset seems pretty nice in my testing. @marlitas or @matthew-blackman want to review/test? |
Played around with some different scenarios and I am not seeing any remaining issues related to reset functionality. Commits are small, and seem appropriate. No concerns here. Ready to close if @samreid is. |
Thanks! Closing. |
Reopening because there is a TODO marked for this issue. |
I could use help on the remaining TODO. |
@samreid and I tested the behavior without the dragPositionProperty being reset, and found no issues. The valueProperty of the soccerBall is now being reset correctly. We feel that this issue can be closed. |
Sim can get frozen.
card arrow can show over nothingness
The text was updated successfully, but these errors were encountered: