From c997b89a3cfefa550b247ebe228c5deec3ff099a Mon Sep 17 00:00:00 2001 From: zepumph Date: Thu, 3 Mar 2022 16:31:07 -0700 Subject: [PATCH] remove validateAssociationObject (there is a Typescript type), https://github.com/phetsims/scenery/issues/1346 --- js/accessibility/pdom/ParallelDOM.ts | 8 ++++---- js/nodes/Node.ts | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/js/accessibility/pdom/ParallelDOM.ts b/js/accessibility/pdom/ParallelDOM.ts index 2abc611fc..1d50b4255 100644 --- a/js/accessibility/pdom/ParallelDOM.ts +++ b/js/accessibility/pdom/ParallelDOM.ts @@ -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 ) { @@ -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 ); } /***********************************************************************************************************/ @@ -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). @@ -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 ); diff --git a/js/nodes/Node.ts b/js/nodes/Node.ts index 7c94403ec..67482de96 100644 --- a/js/nodes/Node.ts +++ b/js/nodes/Node.ts @@ -648,8 +648,6 @@ class Node extends ParallelDOM { this._enabledProperty = new TinyForwardingProperty( 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( DEFAULT_OPTIONS.clipArea ); @@ -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 );