Skip to content

Commit

Permalink
Made all components default to tabindex=1 instead of tabindex=0 and a…
Browse files Browse the repository at this point in the history
…llow clients to optionally override the tabindex, see #40
  • Loading branch information
samreid committed May 11, 2013
1 parent 2065c8c commit 3c756e5
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion js/util/AccessibilityPeer.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,17 @@ define( function( require ) {
var peer = this;

options = options || {};

//Defaulting to 0 would mean using the document order, which can easily be incorrect for a PhET simulation.
//For any of the nodes to use a nonzero tabindex, they must all use a nonzero tabindex, see #40
options.tabIndex = options.tabIndex || 1;

// TODO: if element is a DOM element, verify that no other accessibility peer is using it! (add a flag, and remove on disposal)
this.element = ( typeof element === 'string' ) ? $( element )[0] : element;
this.instance = instance;
this.trail = instance.trail;

this.element.setAttribute( 'tabindex', 0 );
this.element.setAttribute( 'tabindex', options.tabIndex );
this.element.style.position = 'absolute';

// TODO: batch these also if the Scene is batching events
Expand Down

0 comments on commit 3c756e5

Please sign in to comment.