Skip to content

Commit

Permalink
Fix mixin existing issue with layout, see phetsims/sun#865
Browse files Browse the repository at this point in the history
  • Loading branch information
jonathanolson committed Dec 20, 2023
1 parent 654f21a commit 6a4eacf
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions js/layout/HeightSizable.ts
Original file line number Diff line number Diff line change
Expand Up @@ -353,8 +353,8 @@ const HeightSizable = memoize( <SuperType extends Constructor<Node>>( type: Supe
} );

// If we're extending into a Node type, include option keys
if ( type.prototype._mutatorKeys ) {
const existingKeys = type.prototype._mutatorKeys;
if ( HeightSizableTrait.prototype._mutatorKeys ) {
const existingKeys = HeightSizableTrait.prototype._mutatorKeys;
const newKeys = HEIGHT_SIZABLE_OPTION_KEYS;
const indexOfBoundsBasedOptions = existingKeys.indexOf( REQUIRES_BOUNDS_OPTION_KEYS[ 0 ] );
HeightSizableTrait.prototype._mutatorKeys = [
Expand Down
4 changes: 2 additions & 2 deletions js/layout/Sizable.ts
Original file line number Diff line number Diff line change
Expand Up @@ -342,8 +342,8 @@ const Sizable = memoize( <SuperType extends Constructor<Node>>( type: SuperType
} );

// If we're extending into a Node type, include option keys
if ( SuperExtendedType.prototype._mutatorKeys ) {
const existingKeys = SuperExtendedType.prototype._mutatorKeys;
if ( SizableTrait.prototype._mutatorKeys ) {
const existingKeys = SizableTrait.prototype._mutatorKeys;
const newKeys = SIZABLE_SELF_OPTION_KEYS;
const indexOfBoundsBasedOptions = existingKeys.indexOf( REQUIRES_BOUNDS_OPTION_KEYS[ 0 ] );
SizableTrait.prototype._mutatorKeys = [
Expand Down
4 changes: 2 additions & 2 deletions js/layout/WidthSizable.ts
Original file line number Diff line number Diff line change
Expand Up @@ -355,8 +355,8 @@ const WidthSizable = memoize( <SuperType extends Constructor<Node>>( type: Super
} );

// If we're extending into a Node type, include option keys
if ( type.prototype._mutatorKeys ) {
const existingKeys = type.prototype._mutatorKeys;
if ( WidthSizableTrait.prototype._mutatorKeys ) {
const existingKeys = WidthSizableTrait.prototype._mutatorKeys;
const newKeys = WIDTH_SIZABLE_OPTION_KEYS;
const indexOfBoundsBasedOptions = existingKeys.indexOf( REQUIRES_BOUNDS_OPTION_KEYS[ 0 ] );
WidthSizableTrait.prototype._mutatorKeys = [
Expand Down

0 comments on commit 6a4eacf

Please sign in to comment.