Skip to content

Commit

Permalink
remove validateAssociationObject (there is a Typescript type), #1346
Browse files Browse the repository at this point in the history
  • Loading branch information
zepumph committed Mar 3, 2022
1 parent 28964a7 commit c997b89
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
8 changes: 4 additions & 4 deletions js/accessibility/pdom/ParallelDOM.ts
Original file line number Diff line number Diff line change
Expand Up @@ -504,7 +504,7 @@ class ParallelDOM extends PhetioObject {
pdomDisplaysEmitter: TinyEmitter<[]>;

// PDOM specific enabled listener
protected pdomBoundEnabledListener: ( enabled: boolean ) => void;
protected pdomBoundInputEnabledListener: ( enabled: boolean ) => void;

constructor( options?: PhetioObjectOptions ) {

Expand Down Expand Up @@ -559,7 +559,7 @@ class ParallelDOM extends PhetioObject {
this._pdomHeadingBehavior = DEFAULT_PDOM_HEADING_BEHAVIOR;
this.focusHighlightChangedEmitter = new TinyEmitter();
this.pdomDisplaysEmitter = new TinyEmitter();
this.pdomBoundEnabledListener = this.pdomEnabledListener.bind( this );
this.pdomBoundInputEnabledListener = this.pdomInputEnabledListener.bind( this );
}

/***********************************************************************************************************/
Expand All @@ -573,7 +573,7 @@ class ParallelDOM extends PhetioObject {
*/
disposeParallelDOM() {

( this as unknown as Node ).enabledProperty.unlink( this.pdomBoundEnabledListener );
( this as unknown as Node ).inputEnabledProperty.unlink( this.pdomBoundInputEnabledListener );

// To prevent memory leaks, we want to clear our order (since otherwise nodes in our order will reference
// this node).
Expand All @@ -588,7 +588,7 @@ class ParallelDOM extends PhetioObject {
this.setActiveDescendantAssociations( [] );
}

private pdomEnabledListener( enabled: boolean ) {
private pdomInputEnabledListener( enabled: boolean ) {

// Mark this Node as disabled in the ParallelDOM
this.setPDOMAttribute( 'aria-disabled', !enabled );
Expand Down
4 changes: 2 additions & 2 deletions js/nodes/Node.ts
Original file line number Diff line number Diff line change
Expand Up @@ -648,8 +648,6 @@ class Node extends ParallelDOM {
this._enabledProperty = new TinyForwardingProperty<boolean>( DEFAULT_OPTIONS.enabled,
DEFAULT_OPTIONS.phetioEnabledPropertyInstrumented, this.onEnabledPropertyChange.bind( this ) );

this.enabledProperty.lazyLink( this.pdomBoundEnabledListener );

this._inputEnabledProperty = new TinyForwardingProperty( DEFAULT_OPTIONS.inputEnabled,
DEFAULT_OPTIONS.phetioInputEnabledPropertyInstrumented );
this.clipAreaProperty = new TinyProperty<Shape | null>( DEFAULT_OPTIONS.clipArea );
Expand All @@ -667,6 +665,8 @@ class Node extends ParallelDOM {
this._appliedScaleFactor = 1;
this._inputListeners = [];

this.inputEnabledProperty.lazyLink( this.pdomBoundInputEnabledListener );

// Add listener count change notifications into these Properties, since we need to know when their number of listeners
// changes dynamically.
const boundsListenersAddedOrRemovedListener = this.onBoundsListenersAddedOrRemoved.bind( this );
Expand Down

1 comment on commit c997b89

@zepumph
Copy link
Member Author

@zepumph zepumph commented on c997b89 Mar 4, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Message should have been: "pdom enabled logic should run on inputEnabled, not enabled, #1369"

Please sign in to comment.