Skip to content

Commit

Permalink
separate model from view: blur method, #814
Browse files Browse the repository at this point in the history
  • Loading branch information
zepumph committed Jul 4, 2018
1 parent df8d387 commit ccc6bf4
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
5 changes: 4 additions & 1 deletion js/accessibility/Accessibility.js
Original file line number Diff line number Diff line change
Expand Up @@ -574,7 +574,10 @@ define( function( require ) {
*/
blur: function() {
if ( this._accessibleInstances.length > 0 ) {
this._accessibleInstances[ 0 ].peer.primarySibling.blur();
assert && assert( this._accessibleInstances.length === 1, 'blur() unsupported for Nodes using DAG, accessible content is not unique' );
var peer = this._accessibleInstances[ 0 ].peer;
assert && assert( peer, 'must have a peer to blur' );
peer.blur();
}
this.interruptAccessibleInput(); // interrupt any a11y listeners that attached to this Node
},
Expand Down
8 changes: 8 additions & 0 deletions js/accessibility/AccessiblePeer.js
Original file line number Diff line number Diff line change
Expand Up @@ -299,6 +299,14 @@ define( function( require ) {
this.primarySibling.focus();
},

/**
* Blur the primary sibling of the peer.
*/
blur: function() {
assert && assert( this.primarySibling, 'must have a primary sibling to blur' );
this.primarySibling.blur();
},


/**
* Removes external references from this peer, and places it in the pool.
Expand Down

0 comments on commit ccc6bf4

Please sign in to comment.