Skip to content

Commit

Permalink
mutate translation options after bounds are set, phetsims/scenery#1340
Browse files Browse the repository at this point in the history
  • Loading branch information
zepumph authored and marlitas committed Jun 28, 2022
1 parent f20ca26 commit 4111d0f
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions js/NumberPicker.js
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,9 @@ class NumberPicker extends AccessibleNumberSpinner( Node, 0 ) {
options.keyboardStep = keyboardStep;
options.shiftKeyboardStep = keyboardStep;

const boundsRequiredOptionKeys = _.pick( options, Node.REQUIRES_BOUNDS_OPTION_KEYS );
options = _.omit( options, Node.REQUIRES_BOUNDS_OPTION_KEYS );

super( options );

//------------------------------------------------------------
Expand Down Expand Up @@ -415,6 +418,9 @@ class NumberPicker extends AccessibleNumberSpinner( Node, 0 ) {
tandem: options.tandem.createTandem( 'valueProperty' )
} );

// Mutate options that require bounds after we have children
this.mutate( boundsRequiredOptionKeys );

// @private
this.disposeNumberPicker = () => {

Expand Down

0 comments on commit 4111d0f

Please sign in to comment.