Skip to content

Commit

Permalink
removed setTimeouts in closeButton listeners, #424
Browse files Browse the repository at this point in the history
  • Loading branch information
zepumph committed Jul 13, 2017
1 parent 0c9ef02 commit d4e70ec
Showing 1 changed file with 2 additions and 8 deletions.
10 changes: 2 additions & 8 deletions js/Dialog.js
Original file line number Diff line number Diff line change
Expand Up @@ -123,16 +123,10 @@ define( function( require ) {
xMargin: 5,
yMargin: 5,
listener: function() {

// This setTimeout call is a workaround until hide and dispose are separated. It should be removed once
// https://github.com/phetsims/joist/issues/424 is complete.
setTimeout( function() { self.hide(); }, 0 );
self.hide();
},
accessibleFire: function() {

// the active element must be focused after the Dialog is hidden, so this must also be wrapped in a
// timeout. This should also be removed once https://github.com/phetsims/joist/issues/424 is complete.
setTimeout( function() { self.focusActiveElement(); }, 0 );
self.focusActiveElement();
},
tandem: options.tandem.createTandem( 'closeButton' ),

Expand Down

0 comments on commit d4e70ec

Please sign in to comment.