Skip to content

Commit

Permalink
Move clearing of focus on down out of Input.js, see phetsims/scener…
Browse files Browse the repository at this point in the history
  • Loading branch information
jessegreenberg committed Oct 7, 2020
1 parent 07b9959 commit 6d462da
Showing 1 changed file with 15 additions and 2 deletions.
17 changes: 15 additions & 2 deletions js/Sim.js
Original file line number Diff line number Diff line change
Expand Up @@ -601,10 +601,23 @@ class Sim {
this.display.domElement.id = 'sim';
document.body.appendChild( this.display.domElement );

// for now interactive descriptions are only in english
// NOTE: When translatable this will need to update with language, change to phet.chipper.local
if ( this.supportsInteractiveDescriptions ) {

// for now interactive descriptions are only in english
// NOTE: When translatable this will need to update with language, change to phet.chipper.local
this.display.accessibleDOMElement.lang = 'en';

// clear focus if we receive a down event, so that focus doesn't interfere
// with mouse/touch interactions
this.display.addInputListener( {
down: event => {

// An AT might have sent a down event outside of the display, if this happened we will not remove focus.
if ( this.display.bounds.containsPoint( event.pointer.point ) ) {
Display.focus = null;
}
}
} );
}

Heartbeat.start( this );
Expand Down

0 comments on commit 6d462da

Please sign in to comment.