Skip to content

Commit

Permalink
disabled component should hide the cue (and remove useless enabledPro…
Browse files Browse the repository at this point in the history
…perty instrumentation), #835
  • Loading branch information
zepumph committed Jan 26, 2024
1 parent b5d531e commit d3535d8
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions js/accessibility/group-sort/model/GroupSortInteractionModel.ts
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,8 @@ export default class GroupSortInteractionModel<ItemModel> extends EnabledCompone
public constructor( providedOptions?: GroupSortInteractionModelOptions<ItemModel> ) {

const options = optionize<GroupSortInteractionModelOptions<ItemModel>, SelfOptions<ItemModel>, ParentOptions>()( {
tandem: Tandem.REQUIRED
tandem: Tandem.REQUIRED,
phetioEnabledPropertyInstrumented: false // enabledProperty doesn't need to be in PhET-iO
}, providedOptions );

super( options );
Expand Down Expand Up @@ -195,7 +196,8 @@ export default class GroupSortInteractionModel<ItemModel> extends EnabledCompone
// of the Node. TODO: add this.enabledProperty into this like is done for soccer-common? https://github.com/phetsims/mean-share-and-balance/issues/141
public mouseSortCueShouldBeVisible(): boolean {
return !this.hasGroupItemBeenSortedProperty.value &&
!this.isKeyboardFocusedProperty.value;
!this.isKeyboardFocusedProperty.value &&
this.enabled;
}

/**
Expand Down Expand Up @@ -227,6 +229,8 @@ export default class GroupSortInteractionModel<ItemModel> extends EnabledCompone
// updates mouseSortCueVisibleProperty() and maybe does other things.
public registerUpdateSortCueNode( updateSortIndicatorNode: () => void ): void {
this.mouseSortCueVisibleProperty.link( updateSortIndicatorNode );
this.showMouseCueProperty.link( updateSortIndicatorNode );
this.enabledProperty.link( updateSortIndicatorNode );
this.selectedGroupItemProperty.link( updateSortIndicatorNode );
this.hasGroupItemBeenSortedProperty.link( updateSortIndicatorNode );
this.isKeyboardFocusedProperty.link( updateSortIndicatorNode );
Expand All @@ -235,6 +239,8 @@ export default class GroupSortInteractionModel<ItemModel> extends EnabledCompone
this.isKeyboardFocusedProperty.unlink( updateSortIndicatorNode );
this.hasGroupItemBeenSortedProperty.unlink( updateSortIndicatorNode );
this.mouseSortCueVisibleProperty.unlink( updateSortIndicatorNode );
this.enabledProperty.unlink( updateSortIndicatorNode );
this.showMouseCueProperty.unlink( updateSortIndicatorNode );
this.selectedGroupItemProperty.unlink( updateSortIndicatorNode );
} );
}
Expand Down

0 comments on commit d3535d8

Please sign in to comment.