Skip to content

Commit

Permalink
wrap workaround for Edge with a platform check for phetsims/a11y-rese…
Browse files Browse the repository at this point in the history
  • Loading branch information
jessegreenberg committed Feb 7, 2018
1 parent 6a77076 commit 65a1f08
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions js/accessibility/AccessibleInstance.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ define( function( require ) {
var Events = require( 'AXON/Events' );
var inherit = require( 'PHET_CORE/inherit' );
var KeyboardUtil = require( 'SCENERY/accessibility/KeyboardUtil' );
var platform = require( 'PHET_CORE/platform' );
var Poolable = require( 'PHET_CORE/Poolable' );
var scenery = require( 'SCENERY/scenery' );

Expand Down Expand Up @@ -229,10 +230,8 @@ define( function( require ) {

var parentElement = this.peer.getParentContainerElement();

// for some reason, wrapping the hiding and bluring in a timeout is a workaround for an Edge bug where unhidden
// elements remain excluded in the navigation order, see https://github.com/phetsims/a11y-research/issues/30
var self = this;
window.setTimeout( function() {
var hideParent = function() {
parentElement.hidden = !( visibilityCount === self.trailDiff.length );

// if we hid a parent element, blur focus if active element was an ancestor
Expand All @@ -241,8 +240,12 @@ define( function( require ) {
scenery.Display.focus = null;
}
}
}, 1 );
}
hideParent();

// wrapping the hiding and bluring in a timeout is a workaround for an Edge bug where unhidden elements remain
// excluded from the navigation order, see https://github.com/phetsims/a11y-research/issues/30
platform.edge && window.setTimeout( hideParent, 1 );
},

/**
Expand Down

0 comments on commit 65a1f08

Please sign in to comment.