Skip to content

Commit

Permalink
bug fixes in cancelling out options that were set by other interactio…
Browse files Browse the repository at this point in the history
…n mode (grab/drag), phetsims/friction#152
  • Loading branch information
zepumph committed Dec 13, 2018
1 parent 001b402 commit 0ba6799
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion js/accessibility/nodes/A11yGrabDragNode.js
Original file line number Diff line number Diff line change
Expand Up @@ -109,14 +109,19 @@ define( require => {

options.grabbableOptions = _.extend( {
containerTagName: 'div',
ariaRole: null,
tagName: 'button'
}, options.grabbableOptions );

assert && assert( !options.grabbableOptions.accessibleName, 'A11yGrabDragNode sets its own accessible name, see thingToGrab' );
assert && assert( !options.grabbableOptions.innerContent, 'A11yGrabDragNode sets its own innerContent, see thingToGrab' );
assert && assert( !options.grabbableOptions.ariaLabel, 'A11yGrabDragNode sets its own ariaLabel, see thingToGrab' );

options.grabbableOptions.innerContent = StringUtils.fillIn( grabPatternString, {
var accessibleNameString = StringUtils.fillIn( grabPatternString, {
thingToGrab: options.thingToGrab
} );
options.grabbableOptions.ariaLabel = accessibleNameString;
options.grabbableOptions.innerContent = accessibleNameString;

// Initialize the node as a button to begin with
node.mutate( options.grabbableOptions );
Expand Down

0 comments on commit 0ba6799

Please sign in to comment.